Work out the encoding size and plane of a Unicode code point.
A code point is the abstract character number, and encoding determines how many bytes represent it. Anything above U+FFFF needs four UTF-8 bytes or a UTF-16 surrogate pair. Emoji sit above U+FFFF, which is why they behave as two units in languages with UTF-16 strings and break naive character counting.
Unicode Code Point
UTF-8 needs 1 byte to U+007F, 2 to U+07FF, 3 to U+FFFF and 4 beyond
UTF-8 needs 1 byte to U+007F, 2 to U+07FF, 3 to U+FFFF and 4 beyond A code point is the abstract character number, and encoding determines how many bytes represent it. Anything above U+FFFF needs four UTF-8 bytes or a UTF-16 surrogate pair.
Emoji sit above U+FFFF, which is why they behave as two units in languages with UTF-16 strings and break naive character counting.
This calculator takes 1 input: Code point value in decimal. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.