ASCII Code Converter

Convert text to ASCII character codes and back online, in decimal, hexadecimal, binary or octal. Both panes are editable, so encoding and decoding update live as you type.

FreeOnline Tool
Loading…

How to Use

  1. Choose the numeric base from the "Format" dropdown: decimal, hexadecimal, binary or octal
  2. Tick "space separated" to put a space between each character code for easier reading, or untick it for compact output
  3. Type in the left "Text" box and the codes appear in the right "ASCII" box in real time; you can also press the "Encode →" button
  4. Working the other way, paste character codes separated by whitespace into the right box and the decoded text appears on the left; the "← Decode" button does the same manually
  5. Press "Copy right side" to copy the current ASCII output to your clipboard

Features

  • Four character-code formats to switch between: decimal, hexadecimal, binary and octal
  • Two-way live conversion - text to codes and codes back to text - with both boxes editable and linked
  • Optional space separator between codes for different pasting and display needs
  • Decoding splits the input on whitespace and rebuilds each character; malformed input shows a "decode failed" warning
  • One-click copy of the encoded result to the clipboard

Use Cases

Learning ASCII encoding
See the decimal, hex, binary and octal code for each character while teaching or studying how character encoding works.
Protocol debugging
Move back and forth between readable text and hex or binary codes when inspecting serial or network protocol data.
Building test data
Quickly produce the ASCII code sequence for a piece of text to use as a fixture when testing encoding logic.
Decoding captured character codes
Paste a run of decimal or hex codes taken from a packet capture or log file and turn it back into readable text.

FAQ

Which numeric bases are supported?
Decimal (for example 72 101), hexadecimal (48 65), binary (01001000) and octal (110 145). Switch between them in the "Format" dropdown.
Can it handle Chinese and other non-ASCII characters?
The tool encodes each character by its Unicode code point (charCodeAt), so any character produces a number. That said, it is designed around printable ASCII (0-127); characters beyond that range produce much larger values and should be treated as informational only.
What happens when decoding fails?
If the codes do not match the selected base - for example letters entered while in decimal mode - the text box shows a "decode failed" warning. Nothing else on the page stops working.
What does the "space separated" option do?
When ticked, each character code in the encoded output is separated by a space, which makes it easier to read and copy individual values; unticked gives you a compact unbroken sequence. Decoding always splits on whitespace, so the option only affects how encoded output is displayed.