Skip to content
Step by Step Internet 馃寪 Guides for learning to surf the Net

How to calculate the letter of the electronic DNI and know what this electronic document is really for? step by step guide

UPDATED ✅ Do you need to know the mathematical algorithm that allows you to obtain the letter of the DNI? ⭐ ENTER HERE ⭐ And discover how to calculate it in your document

One of the most useful documents we have is the electronic DNI or DNI-E, which It is a digital version of the classic National Identity Document. However, many people do not have much idea of ​​how to use it and what advantages it has in taking the time to get it out, since they think that it is something that only businessmen and people related to them need. But they couldn’t be further from the truth.

One of the most important elements of this document is the letter, which is an alphabetic value that is located right at the end of the identification number. This is used as a check to ensure that the number before it is true and correct, so it is not randomly placed. There are several ways to get this letter, which is determined by an algorithm in which the numerical value is divided by 23 and the result is replaced by a letter.

This is something that the authorities do when printing the physical document, but how is it done with the digital version? That’s what you’ll learn in this tutorial where We are going to teach you how to get the letter of the Electronic DNI and we will educate you so that you know what this document is and why it is important that you have it and take advantage of all the benefits that come with it.

What is the electronic DNI and what advantages does it offer us in Spain?

electronic ID parts



The DNI-E is the electronic version of the well-known National Identity Document that allows you to verify your identity when carrying out processes on the internet. In a way it works like a digital signature that allows you to carry out legal procedures with national organizations such as Treasury or Social Securityso you don’t have to leave the comfort of your home and wait hours sitting in an office.

The advantages of this identification document are many, since financial institutions can check your data, which facilitates the exchange of information. One of the benefits of this technology is that you can access your bank account remotely, using your digital trace represented by your thumbprint as an identification element.

In addition, this tool makes it easy for you to sign documents in PDF or Microsoft Word formats. By using it everyone knows that you were the person who carried out the procedure. With this, I want to tell you that the DNI guarantees your identity at all times, reducing the risk of fraud and promotes the use of electronic means, since technology is practically impenetrable.

To use this technology, you need to install a program on your computer, which was developed for Windows, MacOS and Linux operating systems. If by chance your platform is that of the “manzanita” or the “penguin” you must use an OpenDNIe application, for it to work, but in general it is very easy to use on all platforms. If you want activate or renew the Electronic DNI Click here.

Steps to check and calculate the letter of the DNI (National Identity Document) of a person

Calculate the letter of the DNI-E It is one of the easiest things to do, as we told you before, all you have to do is divide your identification number and according to the rest, a letter is attributed to you.

These letters vary and are not in alphabetical order, but you can find out using this table below:
module23

  • If the rest is corresponds the letter T
  • If the rest is 1 corresponds the letter R.
  • If the rest is two corresponds the letter W
  • If the rest is 3 corresponds the letter a.
  • If the rest is 4 corresponds the letter G
  • If the rest is 5 corresponds the letter M.
  • If the rest is 6 corresponds the letter Y.
  • If the rest is 7 corresponds the letter F
  • If the rest is 8 corresponds the Letter p.
  • If the rest is 9 corresponds the letter D.
  • If the rest is 10 corresponds the letter X
  • If the rest is eleven corresponds the Letter B.
  • If the rest is 12 corresponds the letter N
  • If the rest is 13 corresponds the letter J
  • If the rest is 14 corresponds the letter Z
  • If the rest is fifteen corresponds the letters.
  • If the rest is 16 corresponds the letter Q
  • If the rest is 17 corresponds the letter V
  • If the rest is 18 corresponds the letter H.
  • If the rest is 19 corresponds the letter I.
  • If the rest is twenty corresponds the letter C.
  • If the rest is twenty-one corresponds the letter K
  • If the rest is 22 corresponds the letter E

And what about foreigners? Those expatriates residing in Spain have a NIF that is made up of a letter that can be X, Y or Z, a 7-digit number and a control code. The latter is determined in the same way as the letter of the DNI; dividing it by 23 and depending on the result a unique code is determined.

Online Tools

With this program you can calculate the letter of the DNI (National Identity Document) or the letter of the NIF (Tax Identification Number). So, do the following:

  • enter this website.
  • This information appears on the screen:

Calculate-DNI-tools-online

  • write your DNI/NIF in the box and click “calculate letter“.
  • Then he throws your ID with your respective letter. That is all.

The others online tools they are similar in their operation, we leave you the URLs so that you can visit them and carry out the calculation in the one that seems best to you.

  • Notin.es/utilities/calculate-letter-dni
  • Gabilos.com/textocalculadoranif.htm
  • Calculate.site/letter-dni

Excel spreadsheet

The Excel spreadsheetfrom Microsoft Office, offers many functions, and it has one that facilitates the calculation of the DNI/NIF.

the procedure is the next:

  • It all starts in the modulo 23 functionwhich serves as an integer.
  • This one gets like the rest; when making the entire division of the DNI by the number 23.
  • When you use this Excel function, the result will range between the values ​​0 and 22.

The number 14 that is observed on the screen is said resulting in this case, then you must place the letters in the following order: TRWAGMYFPDXBNJZSQVHLCKE.



But… Why is this order followed and not all the letters of the alphabet are there?

module23

  • The reason is that the lyrics were not incorporated I, O, Ñ and U. The first two is to avoid errors and confusion so that they are not interpreted as the numbers 1 and 0. In the case of letter Ñ was not used because they are not used in other European countries, and in the letter U to avoid being compared to V.
  • Being 14 the result of the previous division begins the process of counting spaces, for example for the DNI “12345678“His letter is Z.
  • You must start counting from 0, and not from 1 and as a result you will have the correct order, which is Z, the fourteenth letter of the order that we gave you earlier.
  • I invite you to carry out this example with the online tools that we showed you above and check the result.

To apply all this in Excel you must do the following:

  • You must open the Excel sheet to enter the formula.
  • Later you locate yourself in the cells and create a column listing the DNI and next to the column of numbers, you create another one for the result with the letter.

list_DNI

  • Then you are going to calculate the letter with this formula, remember you should only use the module 23 + the order of the letters.
  • Which would leave you with something like this:
  • MID(“TRWAGMYFPDXBNJZSQVHLCKE”;RESIDUE(A2,23)+1,1)
  • What translated into Spanish means: “When performing the calculation, the rest of the entire division of cell A2 by 23, and when adding one, and you must indicate the letter assigned to the DNI”.

Thanks to the functionalities of the Excel functions, which has among its ranks the Residue, calculates directly, the rest of the entire division of the DNI/23. Then keep in mind the +1, this is because Excel always starts from 1 and not from zero.

It would be as you see it in the following image:

DNI-Letter

  • Excel will allow you to concatenate the DNI and the letter, in a nutshell, you will join the numbers with the letter.
  • What you should do is write the following formula:
  • =CONCATENATE(A2,MID(“TRWAGMYFPDXBNJZSQVHLCKE”,REMIUM(A2,23)+1,1))

That will make everything display as follows:

concatenate

Using a Mathematical Algorithm

To perform this procedure, you should have knowledge of algorithm and programming, in addition to having a development environment software for example Eclipse and the Java Runtime Environment (JRE) which allows you to do the encoding. But don’t worry, I’ll give you the ready-made codes. What I want is for you to have ideas on how to calculate the DNI/NFI using another method.

  • You must keep in mind what you learned in Excel. As for the procedure of using the formula. I remind you: “When calculating the rest of the entire division of cell A2 by 23, and adding one to it, and you must indicate the letter assigned to the DNI” or what is the same; MID(“TRWAGMYFPDXBNJZSQVHLCKE”;RESIDUE(A2,23)+1,1)
  • View the DNI letter tablethis is what the algorithm will do, when executing the program.

letter-dni

  • Proceed to coding in JAVA language. The algorithm is going to do what the excel function did; calculate module 23 to your DNI number.
  • Then to get the lyrics: To do that it executes a String that will belong to the letters in order, so with a charAt (module) you can calculate the letter corresponding to the indicated position. Now I show you the java code that implements the calculation:

Compile_withEcplipse1

Remember to do this, you must have programming knowledge. You can go to a computer science institute or academy and have a qualified computer scientist run the code. The result will be to list the DNI with its respective letter.

Internet