Bhavesh164/json-viewer

Json Stack Viewer

Rust

2

25 commits

updated Sep 28, 2026

See the code

See what people are saying

SourceMessageScoreDate

I built a native macOS JSON viewer and formatter (r/SideProject)

I built JSON Viewer, a native macOS app for formatting, inspecting, and editing JSON. I created it with the help of AI. It includes a collapsible tree view, a text editor with live JSON validation, format and minify actions, JSON ↔ Python dictionary conversion, search, and a property inspector. It…

2

Sep 30, 2026

README

JSON Viewer for macOS

JSON Viewer Logo
A fast, lightweight, native macOS application recreating and elevating the classic online JSON Viewer and Formatter (jsonviewer.stack.hu).

macOS 13+ Swift 6 Tests Universal License


📸 Overview & Split Mode

Experience real-time JSON editing and hierarchical exploration side-by-side:

JSON Viewer Split Mode Split Mode: Monospace Editor (left), Tree Hierarchy with full-width expanded text (center), and Interactive Property Inspector with jump navigation (right).


✨ Features & Walkthrough

1. Hierarchical Tree Viewer with Expandable Full-Width Text

Explore deep JSON structures with collapsible nodes, color-coded type badges, and dynamic full-width multi-line textareas for large text fields:

Tree Viewer and Full-Width Textarea

  • 🏷️ Type Badges matching jsonviewer.stack.hu:
    • 🔵 String (key : "value")
    • 🟢 Number (key : 123)
    • 🟡 Boolean (key : true)
    • 🔴 Null (key : null)
    • 🟣 Object / Array (key {N} / key [N])
  • 📖 Expandable Big Text:
    • Automatic detection for long strings (> 40 characters or newlines).
    • Visual cue badge [ ▾ expand ] and text.badge.plus icon.
    • Full-Width Responsive Textarea: Stretches across the full width of the tree panel and wraps smoothly.
    • Includes a quick Copy button with animated "Copied!" confirmation, character count badge, and native text selection (.textSelection(.enabled)).
  • 🖱️ Context Menus: Right-click any tree node to Expand, Expand All, Collapse, Collapse All, Copy Value, Copy Key, Copy JSON Path (e.g. $.users[0].address.city), or Copy Subtree as JSON.

2. Interactive Property Inspector & Jump Navigation

Inspect element properties in a 2-column table with click-to-jump tree synchronization:

Property Grid Inspector and Jump Navigation

  • 🔗 Clickable Property Names: Clicking on any property name in the grid (e.g. 23 or name) instantly jumps to, selects, and scrolls to that element in the tree.
  • ⚡ Auto-Reveal: Ancestor nodes of target items are automatically unfolded in the tree view.
  • 🧭 Breadcrumb Navigation: Header back button [ < Parent ] allows easy navigation back up the object tree.
  • 🔍 In-Grid Search Filter: Quickly filter through thousands of properties in large objects.
  • 📐 Expandable Grid Values: Built-in [ ▾ more ] / [ ▴ less ] toggles for long values within grid cells.

3. Native Text Editor & Transformations (Middle Tab)

A full-featured code editor with instant syntax feedback and rich serialization tools:

  • ⚡ Editor Actions & Transformations:
    • Format (Beautify): Prettifies JSON with configured indentation (2 spaces, 4 spaces, tabs).
    • Minify: Compresses JSON to a single line without spaces.
    • Stringify: Serializes JSON or text into an escaped JSON string literal with forward slash escaping (\/) and quote escaping (\").
    • Unescape: Unwraps stringified JSON or decode escape characters (\/, \", \\, \n) back into clean formatted JSON.
    • Multi-Format Copy: Copy as Beautified JSON, Minified JSON, Stringified JSON, or Python Object literal.
    • Paste / Clear: Fast clipboard integration and buffer reset.
  • 🛡️ Syntax Validation: Real-time error detection reporting exact line and column numbers.
  • 📊 Status Bar: Real-time line and character counter.
  • 📁 Native macOS File Handling: Open (Cmd+O) and Save (Cmd+S) .json files.

4. Multi-Format Copy & Python Dictionary Serialization

Copy your JSON in whatever format you need directly from the Viewer toolbar, Text Editor, or context menus:

  • 📋 Copy Beautified JSON: Configurable indentation (2-space, 4-space, tabs).
  • ⚡ Copy Minified JSON: Single-line compact JSON.
  • 🔤 Copy as Stringified JSON: Escaped string literal with quotes (\") and forward slashes (\/).
  • 🐍 Copy as Python Dictionary: Native Python dictionary/list representation using True, False, None, and single-quoted strings.
  • 🔄 Automatic Python Dictionary to JSON Conversion: Paste or type any Python dictionary into the editor ({'key': 'value', 'flag': True, 'empty': None}) and it is automatically converted into valid, formatted JSON.

5. Settings Page & Keyboard Shortcuts Cheatsheet

  • ⚙️ Settings (⌘,): Configure indentation (2 spaces, 4 spaces, tabs), forward slash escaping (\/), alphabetical key sorting, auto-unwrapping of stringified JSON, editor font size, and word wrapping.
  • ⌨️ Keyboard Shortcuts Cheatsheet (?): Press ? anytime outside text fields or ⌘ ? anywhere to open a beautiful categorized shortcuts overlay with instant search.

⚡ Performance & Scale

  • Virtualized Rendering: High-performance lazy row rendering capable of smoothly navigating datasets with 15,840+ items and 5MB+ payloads with zero UI lag.
  • Pure Swift Engine: Zero third-party runtime dependencies; built exclusively with AppKit and SwiftUI.

📦 Installation (Pre-built App)

  1. Download JSONViewer-macOS.zip from the GitHub Releases.
  2. Double-click the downloaded .zip file to extract JSONViewer.app.
  3. Drag JSONViewer.app into your /Applications folder.

[!NOTE] First-time Opening on macOS (Gatekeeper): Since this is an open-source application without an Apple Developer ID certificate:

  • Right-click (or Control-click) JSONViewer.app and select Open, then click Open in the prompt.
  • Alternatively, run this command once in Terminal:
    xattr -cr /Applications/JSONViewer.app
    

🚀 Building and Running from Source

Prerequisites

  • macOS 13.0 (Ventura) or later
  • Xcode Command Line Tools (xcode-select --install)

Quick Run via Swift PM

swift run

Build & Install to /Applications

./build_app.sh install

This compiles the release binary, creates the iconset, code-signs the app, installs it to /Applications/JSONViewer.app, and launches it.

Build macOS App Bundle

./build_app.sh run

This builds build.noindex/JSONViewer.app and launches it.

Run Automated Test Suite

swift run JSONViewerTests

⌨️ Keyboard Shortcuts

ShortcutAction
? or ⌘ ?Show Keyboard Shortcuts Cheatsheet Modal
/Focus Search Bar (Quick Jump)
⌘ FFind in JSON / Focus Search Bar
EnterFind Next Match (in Search Field)
⇧ EnterFind Previous Match / Reverse (in Search Field)
⌘ GFind Next Match (Global)
⌘ ⇧ GFind Previous Match (Global)
⌘ ,Open Settings / Preferences Dialog
⌘ 1Switch to Viewer Tab
⌘ 2Switch to Text Editor Tab
⌘ 3Switch to Split View Tab
⌘ ⌥ PToggle Properties Panel (Show / Hide)
⌘ KClear Editor
⌘ ⌥ CCopy as Python Dictionary
⌘ EExpand All Tree Nodes
⌘ ⇧ ECollapse All Tree Nodes
⌘ +Zoom In Font Size
⌘ -Zoom Out Font Size
⌘ 0Reset Font Size to Default (12pt)
⌘ OOpen JSON File
⌘ SSave JSON File
EscDismiss Shortcuts / Search Bar

📜 Credits

Inspired by the original online JSON Viewer and Formatter by Gabor Turi.
Rebuilt natively for macOS in modern Swift.

Bhavesh164/json-viewer

Json Stack Viewer

Rust

2

25 commits

updated Sep 28, 2026

See the code

See what people are saying

SourceMessageScoreDate

I built a native macOS JSON viewer and formatter (r/SideProject)

I built JSON Viewer, a native macOS app for formatting, inspecting, and editing JSON. I created it with the help of AI. It includes a collapsible tree view, a text editor with live JSON validation, format and minify actions, JSON ↔ Python dictionary conversion, search, and a property inspector. It…

2

Sep 30, 2026

README

JSON Viewer for macOS

JSON Viewer Logo
A fast, lightweight, native macOS application recreating and elevating the classic online JSON Viewer and Formatter (jsonviewer.stack.hu).

macOS 13+ Swift 6 Tests Universal License


📸 Overview & Split Mode

Experience real-time JSON editing and hierarchical exploration side-by-side:

JSON Viewer Split Mode Split Mode: Monospace Editor (left), Tree Hierarchy with full-width expanded text (center), and Interactive Property Inspector with jump navigation (right).


✨ Features & Walkthrough

1. Hierarchical Tree Viewer with Expandable Full-Width Text

Explore deep JSON structures with collapsible nodes, color-coded type badges, and dynamic full-width multi-line textareas for large text fields:

Tree Viewer and Full-Width Textarea

  • 🏷️ Type Badges matching jsonviewer.stack.hu:
    • 🔵 String (key : "value")
    • 🟢 Number (key : 123)
    • 🟡 Boolean (key : true)
    • 🔴 Null (key : null)
    • 🟣 Object / Array (key {N} / key [N])
  • 📖 Expandable Big Text:
    • Automatic detection for long strings (> 40 characters or newlines).
    • Visual cue badge [ ▾ expand ] and text.badge.plus icon.
    • Full-Width Responsive Textarea: Stretches across the full width of the tree panel and wraps smoothly.
    • Includes a quick Copy button with animated "Copied!" confirmation, character count badge, and native text selection (.textSelection(.enabled)).
  • 🖱️ Context Menus: Right-click any tree node to Expand, Expand All, Collapse, Collapse All, Copy Value, Copy Key, Copy JSON Path (e.g. $.users[0].address.city), or Copy Subtree as JSON.

2. Interactive Property Inspector & Jump Navigation

Inspect element properties in a 2-column table with click-to-jump tree synchronization:

Property Grid Inspector and Jump Navigation

  • 🔗 Clickable Property Names: Clicking on any property name in the grid (e.g. 23 or name) instantly jumps to, selects, and scrolls to that element in the tree.
  • ⚡ Auto-Reveal: Ancestor nodes of target items are automatically unfolded in the tree view.
  • 🧭 Breadcrumb Navigation: Header back button [ < Parent ] allows easy navigation back up the object tree.
  • 🔍 In-Grid Search Filter: Quickly filter through thousands of properties in large objects.
  • 📐 Expandable Grid Values: Built-in [ ▾ more ] / [ ▴ less ] toggles for long values within grid cells.

3. Native Text Editor & Transformations (Middle Tab)

A full-featured code editor with instant syntax feedback and rich serialization tools:

  • ⚡ Editor Actions & Transformations:
    • Format (Beautify): Prettifies JSON with configured indentation (2 spaces, 4 spaces, tabs).
    • Minify: Compresses JSON to a single line without spaces.
    • Stringify: Serializes JSON or text into an escaped JSON string literal with forward slash escaping (\/) and quote escaping (\").
    • Unescape: Unwraps stringified JSON or decode escape characters (\/, \", \\, \n) back into clean formatted JSON.
    • Multi-Format Copy: Copy as Beautified JSON, Minified JSON, Stringified JSON, or Python Object literal.
    • Paste / Clear: Fast clipboard integration and buffer reset.
  • 🛡️ Syntax Validation: Real-time error detection reporting exact line and column numbers.
  • 📊 Status Bar: Real-time line and character counter.
  • 📁 Native macOS File Handling: Open (Cmd+O) and Save (Cmd+S) .json files.

4. Multi-Format Copy & Python Dictionary Serialization

Copy your JSON in whatever format you need directly from the Viewer toolbar, Text Editor, or context menus:

  • 📋 Copy Beautified JSON: Configurable indentation (2-space, 4-space, tabs).
  • ⚡ Copy Minified JSON: Single-line compact JSON.
  • 🔤 Copy as Stringified JSON: Escaped string literal with quotes (\") and forward slashes (\/).
  • 🐍 Copy as Python Dictionary: Native Python dictionary/list representation using True, False, None, and single-quoted strings.
  • 🔄 Automatic Python Dictionary to JSON Conversion: Paste or type any Python dictionary into the editor ({'key': 'value', 'flag': True, 'empty': None}) and it is automatically converted into valid, formatted JSON.

5. Settings Page & Keyboard Shortcuts Cheatsheet

  • ⚙️ Settings (⌘,): Configure indentation (2 spaces, 4 spaces, tabs), forward slash escaping (\/), alphabetical key sorting, auto-unwrapping of stringified JSON, editor font size, and word wrapping.
  • ⌨️ Keyboard Shortcuts Cheatsheet (?): Press ? anytime outside text fields or ⌘ ? anywhere to open a beautiful categorized shortcuts overlay with instant search.

⚡ Performance & Scale

  • Virtualized Rendering: High-performance lazy row rendering capable of smoothly navigating datasets with 15,840+ items and 5MB+ payloads with zero UI lag.
  • Pure Swift Engine: Zero third-party runtime dependencies; built exclusively with AppKit and SwiftUI.

📦 Installation (Pre-built App)

  1. Download JSONViewer-macOS.zip from the GitHub Releases.
  2. Double-click the downloaded .zip file to extract JSONViewer.app.
  3. Drag JSONViewer.app into your /Applications folder.

[!NOTE] First-time Opening on macOS (Gatekeeper): Since this is an open-source application without an Apple Developer ID certificate:

  • Right-click (or Control-click) JSONViewer.app and select Open, then click Open in the prompt.
  • Alternatively, run this command once in Terminal:
    xattr -cr /Applications/JSONViewer.app
    

🚀 Building and Running from Source

Prerequisites

  • macOS 13.0 (Ventura) or later
  • Xcode Command Line Tools (xcode-select --install)

Quick Run via Swift PM

swift run

Build & Install to /Applications

./build_app.sh install

This compiles the release binary, creates the iconset, code-signs the app, installs it to /Applications/JSONViewer.app, and launches it.

Build macOS App Bundle

./build_app.sh run

This builds build.noindex/JSONViewer.app and launches it.

Run Automated Test Suite

swift run JSONViewerTests

⌨️ Keyboard Shortcuts

ShortcutAction
? or ⌘ ?Show Keyboard Shortcuts Cheatsheet Modal
/Focus Search Bar (Quick Jump)
⌘ FFind in JSON / Focus Search Bar
EnterFind Next Match (in Search Field)
⇧ EnterFind Previous Match / Reverse (in Search Field)
⌘ GFind Next Match (Global)
⌘ ⇧ GFind Previous Match (Global)
⌘ ,Open Settings / Preferences Dialog
⌘ 1Switch to Viewer Tab
⌘ 2Switch to Text Editor Tab
⌘ 3Switch to Split View Tab
⌘ ⌥ PToggle Properties Panel (Show / Hide)
⌘ KClear Editor
⌘ ⌥ CCopy as Python Dictionary
⌘ EExpand All Tree Nodes
⌘ ⇧ ECollapse All Tree Nodes
⌘ +Zoom In Font Size
⌘ -Zoom Out Font Size
⌘ 0Reset Font Size to Default (12pt)
⌘ OOpen JSON File
⌘ SSave JSON File
EscDismiss Shortcuts / Search Bar

📜 Credits

Inspired by the original online JSON Viewer and Formatter by Gabor Turi.
Rebuilt natively for macOS in modern Swift.

Languages

Rust

63.8%

Swift

35.4%