Count the encoded byte size of text in UTF-8, UTF-16, or UTF-32. Choose little- or big-endian byte order, optionally include a byte order mark (BOM), and compare results instantly in your browser.
KB uses 1,000 bytes; KiB uses 1,024 bytes. Counts use the text as entered, with line breaks normalized by the browser. UTF-16 and UTF-32 byte order can be selected above.
0 KB ยท 0 KiB
This free text encoding byte counter measures how much space text uses in UTF-8, UTF-16, or UTF-32. Choose little-endian or big-endian byte order for UTF-16 and UTF-32, and optionally include a byte order mark (BOM). Compare the encoded byte size of whitespace, accented letters, non-Latin scripts, and emoji instantly in your browser.
A character is not always one byte. In UTF-8, characters use between one and four bytes. UTF-16 uses two bytes for most characters and four for characters outside the Basic Multilingual Plane. UTF-32 uses four bytes per Unicode code point. The same text can therefore have a different byte size in each encoding.
Use a byte counter when a system limits data by bytes rather than characters. This can help check API request sizes, database fields, message payloads, file contents, and form submissions. Select the same encoding, byte order, and BOM behavior as the target system, and verify whether additional formatting or protocol data is included.
The text Hello has 5 characters and 5 bytes in UTF-8, 10 bytes in UTF-16, and 20 bytes in UTF-32. The text Hi ๐ has 4 Unicode code points: it takes 7 bytes in UTF-8, 10 in UTF-16, or 16 in UTF-32. The counter lets you compare these sizes.
The tool displays decimal kilobytes (KB), where 1 KB is 1,000 bytes, and kibibytes (KiB), where 1 KiB is 1,024 bytes. Check which unit a service uses before comparing its size limit.
Browsers normally normalize line breaks in a text area. This tool counts the text value as the browser provides it, so the reported size may differ from a file that preserves Windows CRLF or another line-ending format. The BOM option adds the selected encoding's BOM to the reported totals.
Your text is counted locally in your browser and is not uploaded or stored by this tool. Use Clear to remove the text from the input when you are done.