JSON Input

Nothing to check yet. Type, paste or upload JSON in this pane.

Validation Result

What is JSON Validator?

A quick way to find out whether a piece of JSON will parse, and if not, exactly where it breaks. Type it, paste it, upload a file or load one of the two samples, and the verdict follows half a second after you stop editing. A broken document gets the line and column of the first problem, that line shaded red in the editor and a short excerpt with a caret under the bad character.

The rules are the ones in the RFC 8259 JSON specification and ECMA-404, so anything that passes here is accepted by the JSON parser in your code too, and anything rejected here would be rejected there. The difference is in how values are read: numbers stay the text you typed, which is why a bare 8901240544102066246 is reported with every digit instead of the rounded 8901240544102066000 a JavaScript double would give you. The check runs in this browser tab and nothing is sent to a server.

Features

Real-time Validation

Checks your JSON as you type. Green badge means it's valid, red means there's an error, and the strip under the editor says why.

Exact Line and Column

Every error names its line and column, shades that line, and moves your cursor there when you click the red strip.

File Upload

Upload JSON files directly instead of copy-pasting everything.

Sample Data

Try the sample buttons to see valid and invalid examples. The invalid one has four separate mistakes to work through.

Syntax Highlighting

Color-coded JSON makes it easier to spot issues visually.

Local Processing

Everything runs in your browser. Your data stays on your machine.

How to Use

1

Add Your JSON

Type or paste JSON into the left editor. <strong>Paste</strong> reads the clipboard for you once the browser allows it; if it says no, a short message explains and the editor is left alone. <strong>Upload</strong> opens a <code>.json</code> or <code>.txt</code> file, and the two sample buttons load a subscriber record that passes and one that does not.

2

Check Results

The right panel fills in by itself. For valid JSON you get the document type, the number of top-level keys and a key outline in which nested objects are indented under their parent and arrays show their item count, such as <code>devices (array, 1 item)</code>. Press <strong>Sort keys A to Z</strong> and the outline turns alphabetical at every level: in the valid sample the keys directly under <code>subscriber</code> then run <code>account</code>, <code>addOns</code>, <code>dataUsage</code>, <code>devices</code>, <code>plan</code>, <code>status</code>, <code>subscriberId</code>. <strong>Full screen</strong> hides the page header so the two panes fill the screen; press Esc to leave it.

3

Fix Issues

Load <strong>Invalid Sample</strong> to see how a fix-up goes. First the strip reads <em>Line 5, column 22: Trailing comma</em>, pointing at the comma after <code>45.2</code>. Delete it and the next problem shows up: line 10, column 7, where <code>imei</code> has no quotes. Then line 13, column 15, the single-quoted <code>'tablet'</code>, and finally line 14, column 32, another trailing comma. Clicking the red strip each time drops the cursor on the spot, so you never hunt for it.

Use Cases

API Responses

Quick check that an API response is valid JSON before your code tries to parse it. Handy when a proxy or error page sneaks HTML into what should be a JSON body.

Config Files

Validate JSON config files before deployment. One typo can break everything.

Learning

If you're new to JSON, use this to check your work and see what errors look like.

Debugging

Getting parse errors? Validate the JSON first to find the exact problem.

FAQ

Is my data stored?

No. The check is a script on this page that reads the editor text and never sends it anywhere. It accepts exactly what JSON.parse() accepts, so the verdict matches what your own code will do. Paste touches the clipboard just once, when you click it.

What makes JSON invalid?

Missing commas, trailing commas, unclosed brackets, unquoted keys, single quotes, comments, or invalid characters. The validator names the mistake in plain words and gives its line and column: {'subscriberId': 'SUB-1001'} is reported at line 1, column 2 because property names need double quotes. For the detailed syntax rules, check MDN's JSON documentation.

Does it validate JSON Schema?

No, this only checks syntax: does the text parse as JSON. It doesn't check a document against a schema, and it doesn't flag duplicate keys (JavaScript just keeps the last one). If you need a schema to start from, the JSON Schema Generator builds one from a sample. You can learn more about schemas at json-schema.org.

Can I validate large files?

Yes. Validation runs half a second after your last keystroke and parses the whole document each time, so editing a 10 MB file in place means a full re-parse on every pause. Paste the big file once and read the verdict instead. Past a few tens of MB the editor itself becomes the slow part, and jq empty file.json in a terminal is the better check.

Why is my JSON invalid?

Read the red strip under the editor, then click it. The cursor lands on the reported line and column. Most of the time it's a missing comma, a trailing comma, or an unclosed bracket. A missing comma is reported where the parser expected it, at the start of the next value, so when the spot looks fine, look at the end of the line above.

Does sorting the keys alter my JSON?

Only the order of the key outline in the result. Your input is not touched, and the verdict, line and column stay the same. Sorting goes by character code, so capital letters come before lowercase ones and an IMEI key would be listed ahead of account. It helps when you want to check that a field exists in a large object: scan the list alphabetically instead of in whatever order the server wrote it.

Related Tools

Other JSON tools you might find useful: