Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON Formatter & Validator

A lightweight Chrome extension for formatting, validating, and exploring JSON data with an interactive tree view.

Version Manifest

Features

  • Validate JSON with detailed error messages including line and column numbers
  • 🎨 Pretty-print with configurable indent (2 spaces, 4 spaces, or tabs)
  • 📦 Minify JSON to remove all whitespace
  • 🔍 Interactive tree view with collapsible nodes and type indicators
  • 🔤 Sort object keys alphabetically
  • 📊 Export to CSV for flat arrays of objects
  • 📋 Copy to clipboard with one click
  • 💾 Download as .json or .csv file
  • 🌓 Dark/light mode with automatic OS theme detection
  • ⌨️ Keyboard shortcuts (Escape to clear, Ctrl/Cmd+Enter to format)
  • 🔒 100% offline — no data ever leaves your browser

Installation

From Source (Developer Mode)

  1. Download or clone this repository
  2. Open Chrome and navigate to chrome://extensions/
  3. Enable "Developer mode" (toggle in top-right corner)
  4. Click "Load unpacked"
  5. Select the extension directory

Usage

Basic Formatting

  1. Paste or type JSON into the input area
  2. Click Format to pretty-print with the selected indent style
  3. Click Minify to compress JSON to a single line
  4. Click Validate to check if JSON is valid without formatting

Tree View

  1. After formatting or minifying, switch to the Tree View tab
  2. Click the ▼ icon next to objects or arrays to expand/collapse
  3. Values are color-coded by type:
    • Green — strings
    • Red — numbers
    • Purple — booleans
    • Gray — null
    • Blue — object keys

CSV Export

If your JSON is an array of objects with consistent keys (like a table), the ↓ .csv button will appear after formatting. Click it to download a CSV file.

Example:

[
  { "name": "Alice", "age": 30, "city": "NYC" },
  { "name": "Bob", "age": 25, "city": "LA" }
]

Exports to:

name,age,city
Alice,30,NYC
Bob,25,LA

Options

  • Indent: Choose between 2 spaces, 4 spaces, or tabs
  • Sort keys: Check this to alphabetically sort all object keys

Keyboard Shortcuts

  • Escape — Clear all input and output
  • Ctrl/Cmd + Enter — Format JSON

Error Messages

When JSON is invalid, you'll see detailed error messages like:

Invalid JSON: Unexpected token } in JSON (line 5, column 12)

This tells you exactly where the syntax error occurred so you can fix it quickly.

Privacy

This extension:

  • ✅ Works completely offline
  • ✅ Never sends data to any server
  • ✅ Requires no special permissions
  • ✅ Only stores your theme preference (dark/light mode)

Browser Support

  • Chrome 88+ (Manifest V3)
  • Edge 88+
  • Brave 1.20+
  • Opera 74+

Support the Developer

If this extension helped you, consider buying me a coffee! ☕

License

MIT License - feel free to use and modify as needed.

Changelog

v1.0.0 (2024-02-21)

  • Initial release
  • JSON formatting with configurable indent
  • Interactive tree view
  • CSV export for flat arrays
  • Dark/light mode support
  • Keyboard shortcuts

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages