Code Tools

JSON Validator

All tools

Know immediately whether a payload parses, and see its root type and size when it does.

How it works

Four simple steps

1

Paste or drop JSON

Type, paste, or drop a .json file onto the input.

2

Parsed on every edit

The native JSON parser runs as you type.

3

Read any error

Failures show the parser message, usually with a position.

4

Check the summary

Valid input shows root type, size in characters and UTF-8 bytes.

JSON Validator

About JSON Validator

A deployment fails with Unexpected token while reading a config file, and you need to know whether the JSON itself is broken or the problem is elsewhere. Paste the file and you have an answer before you finish reading the stack trace.

The validator runs JSON.parse on every edit. When parsing fails you get the browser's own error message, which usually points to the position of the problem. When it succeeds, a summary line shows the root type (an object with its key count, an array with its length, or a primitive), the number of characters, and the size in bytes as UTF-8, which is what most API size limits measure. You can also drop a .json file onto the input. Leading and trailing whitespace is ignored.

Syntax is only half the story. If required fields and types matter, generate a JSON Schema from a known-good sample and validate against that in your code. To see the fixed document laid out, open it in the JSON pretty-print view, and when two versions disagree you can compare JSON documents path by path.

Validation uses the JSON engine built into your browser, so the file is checked without any network request.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

Characters outside basic ASCII, such as accented letters or emoji, take two to four bytes in UTF-8. If the byte size is larger than the character count, your payload contains such characters.

No. JSON only allows strings, numbers, true, false, null, objects and arrays. JavaScript values like NaN, Infinity and undefined are rejected, as are trailing commas and single-quoted strings.

Yes. A single value such as "hello" or 42 is valid JSON on its own, and the summary shows its type as string or number.

View more FAQs

Related tools

View all

HTML Formatter

Beautify and indent HTML markup.

Open

CSS Formatter

Format and pretty-print CSS.

Open

JS Formatter

Beautify JavaScript code.

Open

JSON Formatter

Beautify and validate JSON.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools