JSON Online Formatter Editor

Free online JSON processing for formatting, minifying, validation, JSON5, diffing, masking, and multi-format conversion. Core processing runs locally in your browser by default.

  • Local processing
  • Huge files
  • JSON5 ready
  • Diff / convert

Best-in-class Compatibility — More Tolerant than JSON5

Why does broken JSON that fails in other tools format perfectly here? Because this JSON online formatter editor ships JSON5 plus a stack of additional enhancements — number precision, character encoding, array layout, and indentation — turning "ugly-looking" JSON into readable structured data.

JSON5 is the community-driven superset of JSON proposed after ES5, adding unquoted keys, single-quoted strings, trailing commas, and Infinity / NaN — features that most strict parsers still reject. On top of an embedded JSON5 parser, this JSON online formatter editor layers undefined normalization, # comments, non-standard escape protection, and automatic number-precision preservation, making it one of the more forgiving JSON parsers among popular online tools.

  • Full JSON5 support, plus undefined valuesAccepts common "pseudo-JSON" and JS-style values from API debugging, then turns them into valid JSON in one click.
    • Unquoted keys, single-quoted strings, and trailing commas in arrays / objects
    • Infinity / NaN and other JSON5 special values are accepted, then normalized to null in standards-compliant JSON output
    • Extra support for undefined, which is not part of JSON5: only value-position undefined is converted to null, without touching strings, comments, or keys named undefined
  • Three comment styles, beyond JSON5JSON5-compatible and extended with # comments.
    • // line comments
    • /* block comments */
    • # line comments (not in JSON5 spec — this tool extends it)
  • Lossless number preservationNumeric-literal preservation is permanently on — zero precision loss.
    • Big integers beyond Number.MAX_SAFE_INTEGER (snowflake / order IDs) emitted byte-for-byte
    • Floats with trailing zeros (1.10) never collapsed to 1.1
    • Exponential forms (1e10) preserved exactly through formatting
  • Array layoutToggle "Array style: newline / compact" in Settings.
    • Compact mode applies only to arrays of primitives (string / number / boolean / null)
    • Arrays of complex objects keep wrapping — no hundreds-of-fields-on-one-line nightmare
  • Controllable indentExisting indentation style is preserved.
    • Indent at 2 / 4 / 8 spaces, your choice
    • On paste, the Editor pane auto-detects the source indentation and switches the display intelligently
  • Reversible character encodingPerfect for debugging "why is the frontend receiving a wall of \u4e2d\u6587".
    • Decode on: \uXXXX and \xHH escapes are restored automatically
    • Decode off: escape sequences kept verbatim for raw payload comparison
    • Incomplete \u / \x escapes and other non-standard backslash escapes are protected where possible, preserving the original character information instead of failing immediately or silently dropping content

Power-User Tips

This JSON online formatter editor ships with a number of hidden optimizations for browsing, editing, and debugging JSON. Mastering the tips below will multiply your efficiency.

🚦 Precise Error Location

Enable "Syntax validation" in Settings; errors are highlighted with red squiggly lines as a visual cue.

Combine that with the "Jump to error" button at the bottom-right of the Editor pane status bar to instantly jump to the broken line — a lifesaver when dealing with complex JSON where the bug is not visually obvious, or with thousands of lines of dirty data that simply will not format. The most tedious part of debugging shrinks down to a single click.

📊 Status Bar Live Info

Each pane has its own bottom status bar, intelligently switching based on cursor and selection state:

  • Cursor / selection basics: line, column, total lines, selected lines and characters.
  • Whole-document match counter: if the selection has duplicates elsewhere, "N matches" is appended — no search panel needed.
  • On Select All, file size shows up — computed in UTF-8 bytes (3B per CJK char, 4B per emoji), no external tool required.
  • In Diff mode, the two sides refresh independently.

🗂️ Folding Summary at a Glance

In the Preview pane, when you fold any JSON node, the trailing label automatically shows the size of that node:

  • Objects show "N keys" once folded — i.e. the object contains N keys
  • Arrays show "N items" once folded — i.e. the array contains N elements
  • You can size up every object or array without ever expanding them. When facing a deeply nested JSON of tens of thousands of lines, paired with Monaco's indentation guides, you can build a top-down structural understanding of the entire payload extremely fast — the most efficient way to explore large JSON.

🎯 AST-based Smart Selection · One-click Base64 / URL Encode-Decode

Double-click in either the Editor pane or the Preview pane is powered by AST tokenization, so it cleanly selects entire string boundaries even across quotes and escape sequences — completely different from the traditional "select word" behavior.

  • Double-click a string in the Editor pane: select only, no copy (handy for editing)
  • Double-click a string in the Preview pane: select and auto-copy to clipboard (handy for grabbing values)
  • Right-click on a selection: encode / decode the selected text in place as Base64 or URL — no need to switch to a separate tool when working with tokens, signatures, or URL params.
  • Available in Diff mode too: both the left and right editors support smart double-click selection plus right-click Base64 / URL encode-decode, so you can debug API request/response differences without leaving the diff view.

🧰 Editor Context Menu: common transformations next to the cursor

The Editor pane context menu is more than copy and paste. It puts the most common local JSON debugging actions right next to the cursor; with a selection it works on the selected text first, and without a selection it can process the current editor content and write the result to the Preview pane.

  • Clipboard and paths: Cut, Copy, Paste, and Copy Path let you copy the current field path in one click — useful for locating API fields, writing masking rules, or preparing sort paths.
  • Send to Diff: send the current editor content directly to the left or right side of JSON Diff. The action is shown only when the target side is empty, so existing diff content is not overwritten accidentally.
  • Encoding actions: Base64 encode / decode and URL encode / decode selected text in place, ideal for tokens, signatures, cookies, and URL parameters.
  • Array actions: sort arrays, deduplicate arrays, convert arrays to text lines, or extract values by key — fast for ID lists, enums, and API response arrays.
  • Text-line actions: sort lines, deduplicate lines, convert text lines to an array, remove blank lines, trim every line, and batch add / remove prefixes or suffixes — handy for turning logs, CSV fragments, or field lists into JSON-ready data.

🔄 One-click Content Transfer (preserves folding state)

Above the draggable splitter between the Editor and Preview panes there is a square button with an arrow icon (pointing toward the Editor pane). Clicking it transfers the processed result from the Preview pane back into the Editor pane.

Not only the data is transferred — the folded state of nodes in the Preview pane is preserved too. So when working with large, complex JSON you can stay focused on the layer you are currently analyzing, without having everything re-expanded after each format pass.

📐 Double-click the pane header: toggle 50% / 100% width

Double-clicking the title bar above the Editor or Preview pane toggles between "50/50 split" and "100% full width". This is especially handy when working with very long lines or extremely dense JSON.

📋 Multi-format Auto-folding

The Editor pane recognizes more than just JSON — when you paste YAML / TOML / XML / CSS / HTML, it automatically provides folding by indentation or tag structure, making it a fine general-purpose structured-text viewer.

⌨️ Full Monaco Shortcuts

A complete set of VS Code-compatible shortcuts — zero learning curve for veteran developers.

ActionWindows / LinuxmacOS
UndoCtrl+ZCmd+Z
FindCtrl+FCmd+F
Go to line numberCtrl+GCtrl+G
Toggle line / block commentCtrl+/Cmd+/
Move line up / downAlt+ / Alt+Option+ / Option+
Add multi-cursor above / belowCtrl+Alt+ / Ctrl+Alt+Cmd+Option+ / Cmd+Option+
Jump to file start / endCtrl+Home / Ctrl+EndCmd+ / Cmd+

Frequently Asked Questions

Is it free?

Completely free. No registration, no login, no ads — just open and use.

Is my JSON data uploaded to any server?

By default, no. In this JSON online formatter editor, parsing, formatting, minifying, escape / unescape, sorting, diffing, masking, and converting JSON to YAML / TOML / XML / Go struct / TypeScript all run locally in your browser. Your data is only sent to the server when you explicitly use the "Share" or "Fetch JSON" feature.

How does the Share feature handle my data?

When you click "Generate share link", the tool uploads your JSON to the server in order to produce a short URL, with an automatic expiration policy. Please do not share sensitive data, or use the "Mask" feature first.

Does the "Fetch JSON" feature go through your server?

Yes. Due to browser CORS restrictions, the request is proxied through our server to the target URL. We do not persist your request or response.

What size limits apply to the JSON?

The tool tries to process large JSON locally in the browser, using virtual scrolling, on-demand folding, and Web Worker analysis to reduce UI stalls. The practical size depends on your browser, device memory, JSON structure, and enabled features.

Is the field path syntax used by sorting, Copy Path, and masking standard JSONPath?

Not full standard JSONPath. The tool uses a lightweight JSONPath-style path syntax. Sorting and Copy Path mainly support exact paths such as a.b.c, a[0].b, and a[*].b. Masking extends that base syntax with extra matching operators such as *, [*], and |. A good mental model is “common member access + array index / wildcard, without the root $ and without full JSONPath features like filters or recursive descent”.

What naming rules does JSON-to-Go struct conversion follow?

It follows the official Go lint CommonInitialisms whitelist: common acronyms like ID, URL, API, and HTML are fully capitalized (e.g. userID → UserID), while other segments use standard CamelCase.