Format Code Now
/

JSON Decode Online

FV-27

Paste JSON and click JSON decode to get readable, indented output with \u escapes turned into real characters. A quoted string that holds JSON is unwrapped too.

Runs in your browser. Nothing is uploaded.

JSON or a JSON string

Decoded JSON

How to use it

  1. Paste your JSON, or a quoted JSON string, into the input box.
  2. Choose the indent: 2 spaces, 4 spaces or a tab.
  3. Click JSON decode. Use Decode and minify for one compact line, or Beautify, keep escapes to leave the \u sequences as they are.
  4. Copy the result or download it as a .json file.

What decoding changes

Every string and key is rewritten without needless escapes, so \u00e9 becomes é and a surrogate pair such as \ud83d\ude00 becomes the emoji. Escapes that have to stay, like \n, \t and a quote inside a string, are kept so the output is still valid JSON. Numbers are copied exactly as written, so a value such as 12345678901234567890 is not rounded.

Strings that hold JSON

APIs and logs often store JSON inside a string, so the whole text starts and ends with a double quote and every inner quote is escaped. When the input is one such string and its content is an object or array, the tool decodes that content as well. If the content is plain text, you get the text itself. Turn the option off to treat the input as a single string value only.

Strict JSON only

The parser follows the JSON standard. Comments, single quotes, unquoted keys and trailing commas are errors with a line and column. For that kind of input use the String to JSON or JSON5 tools. This page does not build PHP arrays, so it is not a stand-in for PHP's json_decode.

Error messages and what to do

MessageWhat it meansFix
Unexpected end of inputThe JSON stops before a value, bracket or quote is closed.Check for a missing closing bracket, brace or quote at the end.
Expected a string keyAn object has something other than a double-quoted key where a key should be.Put the key in double quotes and remove any trailing comma.
Unexpected data after the end of the JSON valueThere is more text after one complete JSON value.Remove the extra text, or paste one JSON document at a time.

Questions people ask

How do I decode JSON online?

Paste the JSON and click JSON decode. The tool parses it, writes it back with your chosen indent, and turns \u escapes in strings and keys into readable characters. If the JSON is invalid, you get the line and column of the problem.

How do I decode unicode escapes like \u00e9 in JSON?

Click JSON decode. Each \uXXXX escape inside a string becomes the character it stands for, and pairs such as \ud83d\ude00 become one emoji. Escapes that JSON requires, such as \n or an escaped quote, are kept.

Can it decode a JSON string that contains JSON?

Yes. If the input is a single quoted string whose content is a JSON object or array, the content is decoded and indented. If the content is not JSON, the string is shown as plain text. You can switch this behaviour off with the option.

Are large numbers changed?

No. Numbers are kept as written, so integers beyond 2^53 and long decimals come out exactly as they went in. Many tools convert them to floating point and round them, which is why this parser keeps the original digits.

What is the difference between decode and beautify here?

Both indent the JSON. JSON decode also rewrites strings so \u escapes become characters. Beautify, keep escapes leaves every string exactly as typed. Use the second if you need the text to stay byte for byte the same apart from spacing.

About this tool

Decode parses the JSON and writes it out indented, with every \uXXXX escape in strings and keys turned into the character it stands for. Escapes that must stay, such as \n, \t or a quote inside a string, are written back as escapes so the output is still valid JSON. Numbers are kept exactly as written, so 12345678901234567890 is not rounded. If the whole input is one quoted string whose content is a JSON object or array, that content is decoded as well; if it is plain text, the text itself is shown. Beautify keeps the original escapes. Comments, single quotes and trailing commas are errors here, since this is strict JSON. It is not PHP's json_decode and does not build PHP arrays. Nothing is uploaded.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.