Skip to content

soumendrak/json-pretty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JSON Pretty Logo

{JSON} Pretty

A polished, single-file JSON formatter, validator, and tree-view explorer — all in one HTML page. No build step, no dependencies, deploy anywhere.

🌐 Live Demo · Features · Usage · License

Format Validate Tree View Zero Deps License


✨ Features

  • Format — Pretty-prints JSON with full syntax highlighting (keys, strings, numbers, booleans, null)
  • Minify — Compresses JSON to a single line
  • Validate — Validates JSON syntax with detailed error messages including line & column numbers
  • Tree View — Interactive expandable/collapsible JSON tree with clickable keys
  • Drag & Drop — Drop .json files directly onto the page
  • Copy — One-click copy of formatted output to clipboard
  • Stats — Real-time character and line counts
  • Dark Theme — Eye-friendly dark UI with orange accent
  • Responsive — Works on desktop and mobile
  • Zero Dependencies — Everything in one HTML file, no CDN, no build tools

🚀 Usage

Open index.html in any modern browser, or deploy to GitHub Pages / Netlify / any static host.

  1. Paste JSON into the input textarea (or drag-and-drop a .json file)
  2. Click Format, Minify, Validate, or Tree
  3. Use Copy to grab the formatted output

Keyboard shortcut: Ctrl+Enter / Cmd+Enter to format.

🔧 Pipeline

flowchart LR
    A["`Raw JSON Input`"] --> B{"Parse"}
    B -- "✅ Valid" --> C["Format / Minify"]
    B -- "✅ Valid" --> D["Tree View"]
    B -- "❌ Error" --> E["Error Display<br>line + column"]
    C --> F["Syntax Highlighted Output"]
    F --> G["Copy to Clipboard"]
    D --> H["Expand / Collapse<br>Interactive Tree"]
Loading

📁 Files

json-pretty/
├── index.html          # Single-file application (~29 KB)
└── README.md           # This file

🎨 Syntax Highlighting

Token Color Example
Keys Orange "name"
Strings Blue "hello"
Numbers Cyan 42, 3.14
Booleans Purple true, false
Null Purple null

📄 License

Licensed under the MIT License.

About

JSON Formatter — validate, format, tree view

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages