A fast, zero-dependency JSON formatter & viewer — CLI + Web.
Pipe JSON from terminal or paste it in the browser. Inspect instantly.
- Pipe from stdin:
curl ... | json - Inline JSON:
json '{"a":1}' - Auto-opens browser with interactive tree view
- Auto-parse serialized / double-encoded JSON strings
- Cross-platform (macOS / Linux / Windows)
- Paste or drag-and-drop JSON
- Collapsible tree with expand all / collapse all
- Real-time search with highlighting and keyboard navigation
- Parse JSON strings toggle — auto-expand embedded JSON with visual markers
- Light / Dark theme with localStorage persistence
- Resizable split panels
- No server, no upload — everything runs locally
npm i -g @zjy4fun/json-openOr run once without installing:
npx @zjy4fun/json-open '{"hello":"world"}'# API response
curl https://jsonplaceholder.typicode.com/todos/1 | json
# Inline JSON
json '{"name":"test","list":[1,2,3]}'
# File
cat data.json | jsonA common pain point: JSON values that are themselves stringified JSON (from logs, databases, APIs).
# Double-encoded
json '"{\"name\":\"test\"}"'
# Nested JSON string fields
json '{"data":"{\"users\":[{\"id\":1}]}"}'
# Multi-level
json '"\"[1,2,3]\""'json-open detects and unwraps these automatically. In the web viewer, toggle Parse JSON strings to expand them inline — parsed blocks are highlighted with a distinct background and border so you can tell what was originally a string.
json [json-string]
json -h | --help
json -v | --version
Input: stdin (pipe) or inline argument. No input shows help.
Open zjy4fun.github.io/json-open or index.html locally.
- Paste JSON in the left panel, click Format (or
Ctrl+Enter) - Use Expand all / Collapse all in the toolbar
- Search with
Ctrl+F— navigate matches withEnter/Shift+Enter - Toggle Parse JSON strings to expand embedded JSON (highlighted with amber markers)
- Switch theme with the 🌙/☀️ button in the header
Issues and PRs welcome.
git clone https://github.com/zjy4fun/json-open.git
cd json-open
npm install
npm testMIT
