Text

Text to Decimal Converter

Details

How to use Text to Decimal Converter

What the tool does, how to run it, and what to expect from the result.

How to convert text to decimal byte values

Type or paste text and the decimal value of each UTF-8 byte appears immediately, space separated. Everything runs locally, so the text never leaves the browser.

The values are bytes, always 0 to 255, which is what a byte array in any language holds. Non-ASCII characters produce several bytes each, so the count of numbers is the byte length rather than the character count.

  • Type or paste the text, for example Hello.
  • Read the decimal byte values, for example 72 101 108 108 111.
  • Replace the spaces with commas to build an array literal.
  • Count the values to get the exact byte size of the string.
  • Press Copy result to take the numbers away.

Bytes, code units, and code points are three different numbers

This page prints bytes. That is not the same as the number you get from most language APIs, and the mismatch is the single most common reason two tools disagree about the same character. JavaScript charCodeAt returns UTF-16 code units, Python ord returns Unicode code points, and both of those can exceed 255. A byte never can.

For plain ASCII all three agree, which is why the difference goes unnoticed until an accent appears. The letter e with an acute accent has code point 233, a single UTF-16 code unit of 233, and two UTF-8 bytes of 195 and 169. All four numbers describe the same character; they just answer different questions. If you are sizing a buffer, writing a file, or checking a length limit measured in bytes, the byte values on this page are the ones that matter.

  • UTF-8 byte (this page): always 0 to 255, one or more per character.
  • UTF-16 code unit (JavaScript charCodeAt): 0 to 65535, one or two per character.
  • Unicode code point (Python ord): 0 to 1114111, exactly one per character.

Turning the output into a byte array

The values come out space separated because that is the neutral form, easy to read and trivially reshaped. Swap the spaces for ", " and wrap the result in brackets and you have a valid Python list, a JavaScript array, or a C initialiser: 72 101 108 108 111 becomes [72, 101, 108, 108, 111]. Every value is already inside the range an unsigned byte type expects, so no clamping is needed.

One language needs an extra step. Java and Kotlin bytes are signed, running from -128 to 127, so a value this page shows as 200 appears as -56 in a Java byte array. The bit pattern is identical and only the interpretation differs, so add 256 to any negative Java byte to recover the number printed here.

Tips

Getting a better result out of Text to Decimal Converter

Specific settings and thresholds, not general advice.

  • The output is the decimal value of every UTF-8 byte, which is exactly what a byte array literal contains. Hello becomes 72 101 108 108 111.
  • Every value is between 0 and 255 by definition, because a byte cannot hold more. If you see a number above 255 anywhere, you are looking at code points, not bytes.
  • Non-ASCII characters expand, so cafe with an accented e is five bytes (99 97 102 195 169), not four. Byte count and character count are different numbers.
  • The byte count is the file size: Hello saved as a UTF-8 text file is 5 bytes, or 6 with a trailing newline.
  • Java prints bytes as signed, so a byte the tool shows as 200 appears as -56 in a Java byte array. Add 256 to any negative Java byte to line the two up.
Limits

What Text to Decimal Converter does not do

The honest boundary, so you do not lose time finding it yourself.

  • No comma, array bracket, or 0x formatting, the values are space separated.
  • UTF-8 bytes only, not Unicode code points and not Latin-1 values.
  • No signed-byte view, values are always 0 to 255.
  • Text input only, it will not read a file.
At a glance

Who Text to Decimal Converter is for

A quick way to understand who this helps, what it solves, and where it connects next.

Best fit

Developers, students, and engineers who need a quick, reliable text to decimal converter.

Ideal for

Fast Text to Decimal conversion without a backend, install, or sign-up.

FAQ

Common questions

Short answers for the questions people usually have before trying a utility like this.

Does my data get uploaded anywhere?

No. Everything runs locally in your browser and nothing is sent to a server.

Is this free to use?

Yes. It is completely free, with no account, no signup, and no usage limits.

Does it work on a phone?

Yes. The page runs in any modern mobile browser, on iPhone and Android alike, with no app to install.

How do I turn the output into a byte array for my code?

Copy it and replace the spaces with commas. 72 101 108 108 111 becomes [72, 101, 108, 108, 111], which is a valid list in Python, an array in JavaScript, and an initialiser in C. The values are already in the 0 to 255 range every byte type expects.

Why does a 4-letter word give 5 numbers?

Because one of the characters is not ASCII. UTF-8 encodes anything above 127 in two, three or four bytes, so a word with an accented letter produces more bytes than it has characters. The count you see is the true byte length.

Why is no value ever above 255?

Because each value is one byte, and a byte holds 8 bits, which caps it at 255. Characters beyond ASCII are represented by several bytes rather than one large number, which is the core design of UTF-8.

Java shows -56 where this tool shows 200, why?

Java bytes are signed, so they run from -128 to 127 rather than 0 to 255. The bits are identical, only the interpretation differs. Add 256 to any negative Java byte value to get the unsigned number this tool prints.

Is this the same as charCodeAt in JavaScript?

No. charCodeAt returns UTF-16 code units, so an accented e gives 233. This tool prints UTF-8 bytes, so the same character gives 195 169. They are different encodings of the same character and the numbers do not match above 127.

What is "Hello" in decimal?

72 101 108 108 111. Those are the ASCII values of the five letters, which are also their UTF-8 byte values because every character is below 128. Capital H is 72, and lowercase h would be 104, exactly 32 higher, which is the constant gap between upper and lower case in ASCII.

Can I convert the numbers back into text?

Yes, with the companion Decimal to Text converter. It accepts the same space or comma separated values and rejects anything outside 0 to 255 by name, because a value above 255 is a code point rather than a byte and would decode to the wrong character.

Is this the same as an ASCII code chart?

For the first 128 values, yes, identically so. Above 127 an ASCII chart has nothing to say, and the extended tables that claim to cover 128 to 255 are Latin-1 or code page 437, which are not UTF-8. This page always shows UTF-8 bytes, so an accented character produces two values rather than one entry from an extended chart.

Recommendations

You Might Also Like

Nearby tools from the catalog that fit the same job or workflow.

Cleanor app

Do it all on your device

Cleanor puts these tools in one app: compress and convert images, video, and audio, work with PDFs, and scan text right on your device. Plus free up storage and clear inbox clutter with Email Cleaner. Start with a free trial.

  • iPhone
  • Android
  • Macsoon
  • Windowssoon