How to read ID, length and value in an EMV payment QR code
Read an EMV merchant-presented data object by taking two digits for the ID and two digits for the length, then that many characters for the value. If the ID identifies a template, read the objects inside its value before continuing at the next outer field.

Read the first field without guessing where it ends
Use the synthetic fragment 00020162100106BILL426004DEMO. It contains no account details and is incomplete for payments. The first six characters, 000201, break down into ID 00, length 02 and value 01. The next object starts immediately after that value.
Follow the length to the next boundary. An ID’s digits can also appear inside an unrelated value.
Read the objects inside template 62
After the first field, 6210 starts the Additional Data Field Template. Its ten-character value is 0106BILL42. That value contains a child object with ID 01, length 06 and the six-character value BILL42. Within template 62, ID 01 is the bill number.
The next outer field is 6004DEMO. Read it only after consuming the full template value. If the template length were 09, the last 2 of BILL42 would fall outside the declared boundary. That is a sign to inspect the earlier length before interpreting the next field.
Compare the breakdown with the raw content
For a code you are authorized to inspect, open the breakdown in EMV QR Reader and copy the raw content into a local scratch file. Compare the outer field and its children with the corresponding substring. Note the parent ID when you report a child field so another developer knows which 01 you mean.
Count characters in the value for the length field. A character may occupy multiple bytes in UTF-8, so a byte count for the complete encoded payload answers a different question. Use the original encoded bytes when you check the CRC separately.
Questions
Does ID 01 always refer to the same field?
The meaning depends on its parent. Root ID 01 is the Point of Initiation Method. Inside template 62, ID 01 is the bill number.
What does the length of a template include?
It counts the template value, including each nested object’s ID, length and value. It excludes the outer template’s own ID and length.