Salesforce Encrypted Field can be used to encrypt the information because encrypted information is sensitive information that we don’t want everyone to see.
Encrypted Field in Salesforce is one of the important topics in Salesforce, so I decided to write a complete article on this.
In this Salesforce tutorial, I will explain the text encrypted field and how to create one in Salesforce Lightning and Classic interface.
Encrypted field in Salesforce
This text-encrypted field is the field that permits the users to reserve the sensitive data in the text-encrypted form and the mask is applied to the data when the data is shown. The other user cannot show this sensitive data without the appropriate permission.
For example, if A person has an account in a bank, there is a lot of encrypted information is sensitive information that we don’t want everyone to see.
To make this more encrypted we can use the text encrypted field for that information from which the other user can not see this sensitive information without the appropriate permission of the account holder. For making the information protective this text-encrypted field is very helpful and useful.
Now, let’s move further and see how to create the text encrypted field type in Salesforce Lightning and Salesforce Classic.
Read Salesforce URL Field Type is Required
Create Text Encrypted Field in Salesforce
How to Create Encrypted Field in Salesforce Lightning
Here, we are creating the text-encrypted field type in Salesforce Lightning.
Consider a scenario: We are using the account object. Inside the account object, we want to add the credit card number as a text encrypted field because the credit card number has sensitive information, and the account holder did not want any other user to see their credit card number.
Here are the following steps:
1. Go to Gear icon –> Click on the Setup option –> Select the Object Manager tab.

2. Here, we want to select the account object. Click on the account object.

3. Under this account object page, there is a details section in which field and relationship options are present. Click on the Fields & Relationships option.

4. For creating the field type click on the new button.

5. Here, we are selecting the Text (Encrypted) field. The text encrypted field allows users to enter any combination of letters and numbers, store them in encrypted form, and then click on the next button.

6. Now enter the details first, fill in the Field Label as Credit Card Number, and then fill in the length as 20. After that, simply click on the field name to fill it in. Click on the Next Button.

7. Now scroll to the bottom of the page, select the Mask Type as Credit Card Number, and then select the mask character. There are two types of masks: the first one is *, and the second one is X. We select the * and then click on the next button.

8. Now, establish the field-level security. Select the profiles to which we want to grant edit access to this field via field-level security. If we do not add field-level security, the field will be hidden from all profiles. Click on the next button.

9. Select the page layout that should include this field. This field will be added as the last field in the first 2-column section of this page layout. Click on the save button.

10. Go to the App Launcher and enter the account object in the search box. Click on the account.
The account object record page is open. There is a details section, and under this section, we can see that the text encrypted field type is created. We can enter the text in the credit card number field; the mask is applied to the data when the text is shown.

In this way, we understand how to create the text encrypted field type in Salesforce Lightning. Let’s Proceed further and learn how to create the text encrypted field type in Salesforce Classic.
How to Create Encrypted Text Field in Salesforce Classic
Here, we are creating the text encrypted field type in Salesforce Classic.
Consider a Scenario. We are using the account object. Inside the account object, we want to add the national insurance number as a text encrypted field because the national insurance number has sensitive information, and the account holder did not want any other user to see their national insurance number.
Here are the following steps:
1. Log into the Salesforce Account –> Click on the Profile Picture –> Select the Switch to Salesforce Classic –> Click on the Setup option.

2. Enter the account in the Quick Find Box. Click on the account drop-down menu. The drop-down list is open, under this drop-down list there is a field option. Click on the Fields option.

3. The account custom field page is open. Scroll to the bottom of the page. There is an Account Custom Fields & Relationships section. For creating the new field click on the new button.

4. Here, we are selecting the text encrypted field. Click on the next button.

5. Now, enter the details. First, fill the Field Label as National Insurance Number and then fill in the length as 20. After that, fill in the field name by simply clicking on the field. Click on the Next button.

6. Now scroll to the bottom of the page, select the mask type as National Insurance Number, and then select the mask character. There are two types of masks: the first one is *, and the second one is X. We select X and then click on the next button.

7. Now establish field-level security. Now select the profiles to which we want to grant edit access to this field via field-level security. Click on the next button.

8. Now, add the custom field to the page layout. Select the page layout that should include this field. Click on the save button.

9. Click on the account object that is present in the nav bar. The account object record page is open.
There is a details section, and under this section, we can see that the text encrypted field type is created. We can enter the text in the National Insurance number field; the mask is applied to the data when the text is shown.

So, with this, we have learned how to create the text encrypted field type in Salesforce Classic.
Conclusion
I hope you have an idea of the Encrypted field in Salesforce. I have also explained step by step how to create the text-encrypted field type in Salesforce Lightning and Salesforce Classic.
You may like the following Salesforce tutorials:
- Create a Time Field Type in Salesforce
- How to Make Text Encrypted Field Required in Salesforce
- How to Select Mask Character in Text Encrypted Field in Salesforce
- How to Create a URL Field Type in Salesforce?
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.