Interactive collapsible JSON/JSONC viewer that opens in your browser. Double-click any .json file to view it as a color-coded, expandable tree.
- Collapsible tree — click keys to expand/collapse nested objects and arrays
- JSONC support — handles
//and/* */comments (strips them without touching URLs in strings) - Color-coded — keys (blue), strings (amber), numbers (green), booleans (purple), null (gray)
- Filter/search —
Ctrl+Fto filter keys/values, matches are highlighted - Keyboard shortcuts —
Ctrl+Eexpand all,Ctrl+Shift+Ccollapse all - Copy to clipboard — one-click button to copy the formatted JSON
- Opens in new browser window — never steals an existing tab
| File | Purpose |
|---|---|
view_json.sh |
Entry point — parses the input file, generates the HTML viewer, opens browser |
_json_viewer_html.py |
Generates a self-contained HTML page with the interactive tree |
_jsonc_format.py |
Strips JSONC comments while respecting string boundaries |
view_json.desktop |
Desktop entry registered as the default handler for application/json |
git clone git@github.com:hardes11/json-viewer.git
cd json-viewer
make installcurl -fsSL https://raw.githubusercontent.com/hardes11/json-viewer/main/install.sh | bashmake uninstallFiles are installed to ~/.local/bin/ and ~/.local/share/applications/. Double-click any .json or .jsonc file afterwards.