Skip to content

ankushmaherwal/json-prettier

Repository files navigation

JSON Formatter / Prettifier

A powerful, free online JSON toolkit built with Next.js that helps developers format, validate, parse, and minify JSON data instantly. No registration required - just open and use!

🌐 Live Demo: https://jsonprettier.in

✨ Features

πŸ”§ JSON Formatter / Prettifier

  • Beautify JSON - Format messy JSON into readable, properly indented code
  • Syntax highlighting - Color-coded JSON for better readability
  • Copy to clipboard - One-click copying of formatted JSON
  • Download formatted JSON - Save formatted files directly
  • Real-time formatting - Instant results as you type

βœ… JSON Validator

  • Syntax validation - Check if your JSON is valid
  • Error highlighting - Pinpoint exact syntax errors
  • Detailed error messages - Clear explanations of what's wrong
  • Line-by-line validation - See exactly where issues occur

πŸ” JSON Parser

  • Visual tree structure - Interactive JSON object tree
  • Data type identification - See data types at a glance
  • Expandable/collapsible nodes - Navigate large JSON easily
  • Statistics - Object size, depth, and property counts

πŸ“¦ JSON Minifier

  • Remove whitespace - Compress JSON to smallest size
  • Preserve functionality - Maintains JSON validity
  • Size comparison - See compression savings
  • Download minified - Save compressed files

πŸš€ Built With

  • Next.js 15 - React framework for production
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first CSS framework
  • React Hot Toast - Beautiful notifications
  • Lucide React - Modern icon library

πŸ› οΈ Tech Stack

  • Frontend: Next.js, React, TypeScript
  • Styling: Tailwind CSS
  • Icons: Lucide React
  • Notifications: React Hot Toast
  • Analytics: Google Analytics
  • Deployment: Vercel (recommended)

πŸ“± Responsive Design

  • Mobile-first - Optimized for all screen sizes
  • Touch-friendly - Easy to use on mobile devices
  • Progressive Web App - Install as native app
  • Fast loading - Optimized performance

🎯 Use Cases

For Developers

  • API Development - Format API responses
  • Configuration Files - Validate JSON configs
  • Data Processing - Parse and analyze JSON data
  • Debugging - Pretty-print JSON for debugging

For Designers

  • JSON Mockups - Format data for prototypes
  • API Documentation - Create readable examples
  • Data Visualization - Understand JSON structure

For Students

  • Learning JSON - Practice with real examples
  • Assignment Help - Format and validate JSON
  • Project Work - Clean up messy JSON data

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/json-prettier.git
    cd json-prettier
  2. Install dependencies

    npm install
    # or
    yarn install
  3. Set up environment variables

    cp .env.example .env.local

    Update .env.local with your values:

    NEXT_PUBLIC_GA_ID=your-google-analytics-id
    NEXT_PUBLIC_SITE_URL=https://your-domain.com
  4. Run development server

    npm run dev
    # or
    yarn dev
  5. Open in browser

    http://localhost:3000
    

πŸ“ Project Structure

json-prettier/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                    # Next.js app directory
β”‚   β”‚   β”œβ”€β”€ about-us/          # About Us page
β”‚   β”‚   β”œβ”€β”€ contact-us/        # Contact Us page
β”‚   β”‚   β”œβ”€β”€ json-minifier/     # JSON Minifier tool
β”‚   β”‚   β”œβ”€β”€ json-parser/       # JSON Parser tool
β”‚   β”‚   β”œβ”€β”€ json-validator/    # JSON Validator tool
β”‚   β”‚   └── page.tsx           # Home page (Formatter)
β”‚   β”œβ”€β”€ components/            # React components
β”‚   β”‚   β”œβ”€β”€ AdPlacement.tsx    # Ad placement component
β”‚   β”‚   β”œβ”€β”€ Footer.tsx         # Site footer
β”‚   β”‚   β”œβ”€β”€ Header.tsx         # Site header
β”‚   β”‚   β”œβ”€β”€ JsonMinifier.tsx   # Minifier component
β”‚   β”‚   β”œβ”€β”€ JsonParser.tsx     # Parser component
β”‚   β”‚   β”œβ”€β”€ JsonPrettifier.tsx # Formatter component
β”‚   β”‚   └── JsonValidator.tsx  # Validator component
β”‚   β”œβ”€β”€ config/                # Configuration files
β”‚   β”‚   └── page-config.json   # Page settings
β”‚   └── lib/                   # Utility functions
β”‚       β”œβ”€β”€ ads-config.ts      # Ad configuration
β”‚       └── use-beautify-counter.ts # Usage counter hook
β”œβ”€β”€ public/                    # Static assets
β”œβ”€β”€ .env.example              # Environment variables template
β”œβ”€β”€ .gitignore               # Git ignore rules
β”œβ”€β”€ next.config.js           # Next.js configuration
β”œβ”€β”€ package.json             # Dependencies
└── README.md               # This file

πŸ”§ Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run lint - Run ESLint
  • npm run type-check - Run TypeScript checks

🀝 Contributing

We welcome contributions! Please see our contributing guidelines:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ“ž Support

πŸ™ Acknowledgments

  • Next.js Team - For the amazing framework
  • Vercel - For hosting and deployment
  • Tailwind CSS - For the utility-first CSS
  • Open Source Community - For inspiration and tools

πŸ“ˆ Roadmap

  • JSON Schema Validator - Validate against schemas
  • JSON to XML Converter - Convert between formats
  • JSON Diff Tool - Compare two JSON files
  • API Integration - Validate against live APIs
  • Dark Mode - Theme switching
  • Keyboard Shortcuts - Power user features

Made with ❀️ by a tech enthusiast who loves building productivity tools

Visit JSON Prettifier | Report Bug | Request Feature

About

json prettier, json beautifier, json formatter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •