Tools

JSON

Format with
Indent
Sort keys
Display
Colours
Paths
Style
Nested JSON

Help

About

  • JSON is part of a set of Tools that run entirely in your browser and keep working offline.
  • Nothing you open or paste leaves this page: the draft is kept only for this tab, so a reload keeps it (up to 2 MB) and closing the tab ends it. The Exact values you turned on are kept with it.
  • A new tab opens on a small sample to try things on; Clear empties it, and it does not come back in that tab.
  • Light / dark — the sun or moon beside Help switches the theme of every tool.

Views

  • JSON — edit the document, with colours, line numbers and live checking. The arrows in the gutter fold objects and arrays; a folded one says how many keys or items it holds. Unfold all and Fold all are at its top right.
  • YAML, CSV, Types, Schema — the document converted, following your edits. Export and Copy take whatever view is shown.
  • Exact values, above Types and Schema, lists the places that hold only a few different strings. Turn one on and it is typed as those strings ("json" | "svg", an enum in the schema) rather than any string.
  • CSV makes every array a table — a row per item, a column per key — one after another under their names. The gutter gives each row's line in the JSON. With several tables, Copy and Export take the one the cursor is in. An array inside a table is a cell of it, written as JSON.
  • CSV in — import a .csv or .tsv file and it opens as JSON, one object per row; paste CSV and Convert CSV to JSON offers the same. Numbers, true, false and null become values; everything else stays text.

Editing

  • Find (the magnifying glass, or Ctrl + F) searches the view shown: the JSON, or the converted view. A match inside a folded value unfolds it. Its button closes it again.
  • Format and Minify, over the text's top right, keep numbers and strings exactly as written, so large IDs are never rounded. The one that matches how the text is laid out stays lit until an edit changes that.
  • Fix appears when the text is almost JSON — comments, trailing commas, single quotes, unquoted keys, NaN, Python's True / None — and corrects just those places.
  • Settings (the cog) — indent and key sorting for Format, syntax colours in every view, the style of the path in the status bar, and turning a string that holds JSON into real JSON, or back.
  • An error is underlined where it is, and its line number shows red; hover it to read the message.
  • Status — on a phone the status bar folds away behind the round button at the bottom right, green while the text is valid and red when it is not. Tap it to open the status, the error and Fix over the editor, and again to fold them away.

Keys

Ctrl+Enter Format
Ctrl+Z / Ctrl+Y Undo / redo, Format, Minify and Fix included
Ctrl+F Find
Enter / Shift+Enter, F3 Next / previous match
Esc Close find
Esc, then Tab Leave the editor (Tab alone indents)
Ctrl+G Go to line
Ctrl+Shift+[ / ] Fold / unfold at the cursor
Shift+Alt+→ / ← Expand the selection to the enclosing value / shrink it back
Tab / Shift+Tab Indent / outdent the selected lines
Ctrl+D Add the next occurrence of the selection
Ctrl+click, Alt+drag More cursors, a rectangular selection
Exact values