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 🔧