Input, format detection, and conversion
Paste your data or upload a .json or .txt file. The tool detects JSON or a supported Python dictionary from the contents. Paste processes automatically; after editing, click Visualize JSON. Python single quotes, True, False, None, escaped text, and adjacent strings are converted to JSON. The input is preserved.
Drag and drop a file
Drop one .json or .txt file anywhere inside the input panel. The panel highlights while you drag over it. Release to load and visualize the file automatically. Files must be at most 2 MB. Unsupported or multiple-file drops preserve your current input and show a message. On mobile, use Upload JSON when dragging files is unavailable.
Search keys and values
Type into Search to find case-insensitive matches in keys and primitive values. Tree View shows matching nodes and their ancestors, opening the relevant branches. Pretty JSON highlights matching text while keeping the full document visible. Clear search restores the tree’s previous folded state. The match count refers to nodes, not individual text occurrences.
Line numbers and syntax errors
The input has a scrolling line-number gutter, and Pretty JSON displays output line numbers. An input syntax error is highlighted in translucent red with its line and column. Output line numbers may differ after formatting or conversion. Copy JSON and Download JSON exclude line numbers.
Download and copy JSON
Download JSON saves the current parsed output as json-lens-output.json. Copy JSON copies that same output. If sorting is selected, the downloaded or copied document includes sorted keys. Search does not remove data from the exported document.
Copy a field’s path
Use Copy path beside a tree node to copy its location, such as $.companyOfficers[0].name. The $ identifies the root; array items use bracket indices. Unusual keys use quoted brackets, for example $["postal-code"]. This is a property-access path, not a full JSONPath query implementation. If clipboard access is unavailable, the path appears below the tree for manual copying.
Expand to a depth
Choose 1, 2, or 3 levels to control how many parent layers open. All levels expands every branch up to the 2,000-visible-node limit. Root is depth zero. At 1 level, root opens and its child containers remain folded. Search may open deeper ancestors to reveal matches.
Sort keys alphabetically
The checkbox above the input sorts object keys at every level in Tree View and Pretty JSON. Array order and input text stay unchanged. Uncheck to restore the parsed order. Sorting uses JavaScript’s character ordering, so uppercase and lowercase may group separately. Numeric-looking object keys follow JavaScript’s ordering rules when sorting is off.
Duplicate-key warnings
Repeated quoted keys within the same object are flagged with their input line numbers. Parsing keeps the last value. The same key in different objects is not a duplicate. Review the original input when you see this warning: a previous value cannot be recovered from the parsed output. Detection is designed for ordinary quoted JSON and Python dictionary keys; it is not a full Python semantic analyzer.
Review conversion and repair changes
Auto-correct suggests repairs for common missing brackets, commas, colons, and quoting errors. Open Review conversion / repair changes to compare the original and changed region. Python conversion also creates a report. The report compares raw text before pretty formatting or sorting. It shows one region from the first change to the last, not a per-edit audit, and truncates large excerpts. Repairs may infer missing values, so review them before copying.
Tree controls and workspace
Click a tree branch to fold or unfold it; use Expand, Collapse, and zoom controls as needed. Drag the divider on larger screens to resize the panels. The divider also responds to arrow keys, Home, and End. Expand to full screen fills the viewport; Escape restores the workspace. Dark and light themes are available on every page.
Limits and privacy
Files are limited to 2 MB and 100 nesting layers; Tree View displays at most 2,000 visible nodes. Processing stays in your browser. Documents are not saved, while theme preferences are stored locally. Large numbers may lose precision. Python tuples, sets, function calls, and arbitrary code are not supported.
For examples, visit the JSON Lens blog.