A lightweight, fast JSON file viewer with collapsible tree view, validation, and search. Set it as your default .json handler for instant pretty-printing.
- π Instant loading - Offline-first PWA with service worker caching
- π File handler - Set as default app for
.jsonfiles (Chromium browsers) - π³ Collapsible tree - Intuitive hierarchical view
- π Copy paths - Click π to copy JSONPath for any value
- π Search - Find keys and values instantly with highlighting
- β Validation - Immediate feedback on JSON validity
- π Statistics - Key count, max depth, arrays/objects count
- π Tree/Raw toggle - Switch between structured and raw views
- β‘ Expand/Collapse all - One-click tree navigation
- π¨ Syntax highlighting - Color-coded types (string, number, boolean, null)
- β¨οΈ Keyboard navigation - Arrow keys, Enter/Space to navigate and expand tree nodes
- π Dark/Light mode - Toggle between themes (remembered across sessions)
- π± Responsive - Works great on desktop and mobile
Visit the GitHub Pages deployment β no install needed.
cd json-viewer
python3 -m http.server 8000Then visit: http://localhost:8000
- Open the app in Chrome/Edge/Brave
- Look for the install icon in the address bar
- Click to install
After installing:
- Right-click any
.jsonfile - Choose "Open with" β "Choose another app"
- Select "JSON Viewer" from the list
- Check "Always use this app"
Now every JSON file opens instantly with beautiful formatting!
- Click any object/array header to expand/collapse
- Nested structures clearly indented
- Type indicators show
Object{n}orArray[n] - Values color-coded by type:
- Strings: blue
- Numbers: purple
- Booleans: orange
- Null: red
- Keys: green
Click the π button on any key to copy its JSONPath to clipboard. Great for:
- API documentation
- Extracting specific values
- jq queries
- Programming references
Example paths:
users[0].nameconfig.database.hostitems[3].metadata.tags[1]
Type in the search box to:
- Find keys by name
- Find values containing text
- Automatically expands matching branches
- Highlights matches
Invalid JSON shows immediate error message with line/position information. Valid JSON shows green checkmark.
Shows at-a-glance:
- Total key count
- Maximum nesting depth
- Number of arrays
- Number of objects
- Tree View: Interactive, collapsible structure (default)
- Raw View: Pretty-printed JSON with syntax highlighting
| Shortcut | Action |
|---|---|
Ctrl/Cmd + O |
Open file |
Ctrl/Cmd + F |
Focus search |
Ctrl/Cmd + D |
Toggle dark/light mode |
β / β |
Navigate between tree nodes |
β |
Collapse node or move to parent |
β |
Expand node or move to first child |
Enter / Space |
Toggle expand/collapse |
Perfect for:
- Inspecting API responses
- Viewing config files
- Debugging JSON data
- Exploring complex nested structures
- Quick validation checks
- Efficient tree rendering with event delegation
- On-demand expansion (collapsed nodes skip rendering)
- Debounced search (250ms) prevents lag on large trees
- 50MB file size limit to prevent browser freezes
- β Chrome/Edge/Brave (full support including file handler)
- β Firefox (works, but no file handler API yet)
- β Safari (works, but no file handler API yet)
Files:
index.html- App shellapp.js- Main logic (parsing, tree building, search)styles.css- Tree styling and syntax colorsmanifest.json- PWA configurationservice-worker.js- Offline caching
- Native JSON.parse - Parsing
- Service Worker API - Offline support
- File Handling API - Default file handler
- Clipboard API - Path copying
Opening JSON files shouldn't require:
- Opening VSCode (too heavy for quick inspections)
- Using browser dev tools (awkward for files)
- Online formatters (privacy concerns, internet required)
This gives you instant, beautiful JSON visualization with path copying and search. Double-click β done.
| Feature | JSON Viewer PWA | VSCode | Browser DevTools | Online Tools |
|---|---|---|---|---|
| Speed | β‘ Instant | Slow start | Medium | Slow (upload) |
| Offline | β | β | β | β |
| Path Copy | β | β | β | Sometimes |
| File Handler | β | β | β | β |
| Lightweight | β | β | β | β |
MIT - do whatever you want with it
Built for instant JSON inspection without opening an IDE π§