Edit JSON
Edit a JSON value by dot/bracket path, format or minify, indent 2/4 spaces. Live validation. Free, offline, client-side, instant, secure.
Edit a single value by path (users[0].name), format with 2/4-space indent,
or minify to a single line. Live validation, smart value type detection (numbers, booleans,
null are recognised; quoted strings stay strings). 100% local.
How to Use Edit JSON
- Paste your JSON in the source textarea. The status badge below validates live - green check for valid, red cross with the parse error for invalid.
- Enter the path to the value you want to change. Dot notation and bracket array indices work:
users[0].name,address.city,nested[2][0]. - Enter the new value. The tool tries
JSON.parseon it first, so42becomes a number,truea boolean,nullactual null,"hello"the string "hello". Unquoted text falls back to a string. - Click Apply edit or press Ctrl/Cmd + Enter. The output shows the modified JSON pretty-printed with 2 spaces.
- Use Format / Minify without applying any edit if you just want to reformat the source. Format buttons offer 2-space and 4-space; Minify produces single-line JSON.
- Copy or download the output as
edited.json.
Frequently Asked Questions
What path syntax is supported?
Dot notation for object keys and bracket notation for array indices: users[0].name, config.servers[2].host, nested[0][1]. The original code used path.split('.') which broke for arrays and for keys that contain dots. The current tokenizer handles arrays correctly. Keys containing literal dots are still not supported through the path UI – you would have to edit the JSON directly.
How does smart value parsing work?
The “new value” field is fed through JSON.parse first. If it parses as valid JSON, that parsed value is used – so 42 sets the field to the number 42, true sets it to boolean true, null sets it to actual null, and "hello" (with explicit quotes) sets it to the string “hello”. If parsing fails, the raw text is used as a string – so hello (no quotes) just becomes the string “hello”.
Does this tool accept JSON5 / JSONC / comments?
No, only strict standard JSON as defined by RFC 8259. JSON.parse throws a SyntaxError on comments, trailing commas, unquoted keys, and single-quoted strings. An older version of this FAQ claimed “comments are stripped during parsing” – that was wrong. JSON.parse does not strip; it rejects. If you need comments, strip them first or use a JSONC-aware tool.
What does the status badge show?
Live validity (parses your input on every keystroke, debounced 100 ms). Green = valid JSON. Red = parse error with the message from JSON.parse. The stats line below shows the input size, root type (object / array / string / etc.), maximum nesting depth, and the parse time.
What’s the difference between 2-space and 4-space indent?
Cosmetics. 2-space produces more compact pretty-printed JSON (preferred in most modern JS / TS projects). 4-space produces taller output with more visual nesting separation (often preferred in Python or Java ecosystems). Both are emitted via JSON.stringify(value, null, indent).
How big can the JSON be?
Bounded by browser memory. Pretty-printed JSON in the megabytes range typically works fine for parse and edit; documents in the tens of megabytes start to lag in the textarea. For very large files, prefer a CLI tool like jq or a streaming parser.
Is anything sent to a server?
No. The page loads three static files (HTML, CSS, JS) and then runs entirely in your browser. You can disconnect from the internet after the page loads. No analytics, no tracking, no cookies. Useful for sensitive config files and API responses.
Is this tool free?
Yes – free, unlimited, no signup, no watermark. Use the output in any context. Attribution to is appreciated but not required.