All free tools

JSON Formatter & Validator

🌐 Global

Beautify, minify, validate, escape, and copy.

Input

Output (157 chars)

Related free tools

Free, no login. Need a custom version? Talk to us.

About JSON Formatter & Validator · বিস্তারিত

Paste JSON and the tool validates it as you type, then beautifies it with 2- or 4-space indentation, minifies it onto one line, escapes it into a quoted string, or unescapes a quoted string back to plain text. If the JSON is invalid, it shows your browser's parser error instead of a result.

Validation uses the same JSON.parse that JavaScript itself uses, so if the tool accepts your input, any standard JSON parser should too. Common reasons it refuses: a trailing comma after the last item, single quotes instead of double quotes, comments, or unquoted keys. The error text from the browser usually names the problem and its position.

Escape is the step you need when JSON has to sit inside another string, for example in an environment variable, a curl command or a test fixture: quotes become \" and line breaks become \n. Unescape does the reverse when an API or log hands you a JSON string full of backslashes.

How to use it · কীভাবে ব্যবহার করবেন

  1. Paste your JSON

    Put it in the input box, or press Load sample to try the tool. The character count updates as you type.

  2. Choose an action

    Beautify, Minify, Escape (string) or Unescape.

  3. Pick indentation

    When beautifying, choose 2 spaces or 4 spaces.

  4. Copy the output

    The result appears on the right with its length. Press Copy, or read the error message if the input is not valid.

When it helps · কখন কাজে লাগে

Reading API responses
Turn a one-line response from a payment gateway, courier API or webhook log into indented JSON you can actually read.
Shrinking config before sending
Minify a JSON payload before pasting it into a request body or a query parameter.
Putting JSON inside code
Escape a JSON block so it can be pasted as a string literal in JavaScript, Python or a shell script.

Example: escaping a small object

Input {"name":"Shomoy","active":true} with Escape (string) becomes "{\"name\":\"Shomoy\",\"active\":true}", ready to paste inside quotes in code. Beautify with 2 spaces puts each key on its own line instead, and Minify removes all spaces and line breaks.

What you get

  • Live validation with the browser's own JSON parser
  • Beautify with 2 or 4 spaces
  • Minify to a single line
  • Escape to a JSON string literal and unescape back
  • Input and output character counts
  • Your last input is remembered in this browser

বাংলায়: JSON ফরম্যাটার ও ভ্যালিডেটর

এক লাইনের জট পাকানো JSON এখানে পেস্ট করলে সাথে সাথে সুন্দর করে সাজিয়ে দেখায় (২ বা ৪ স্পেস), আবার চাইলে এক লাইনে ছোট (minify) করে দেয়। JSON-এ ভুল থাকলে আউটপুটের জায়গায় ব্রাউজারের এরর মেসেজ দেখায়, তাই কমা বা কোটেশন কোথায় ভুল তা খুঁজে পেতে সুবিধা হয়। কোডের ভেতরে বসানোর জন্য escape আর উল্টোটা unescape-ও করা যায়। সব কাজ আপনার ব্রাউজারেই হয়।

JSON-এ এরর দেখাচ্ছে কেন?

সাধারণত শেষ আইটেমের পরে বাড়তি কমা, সিঙ্গেল কোটেশন বা কমেন্ট থাকলে এমন হয়। এগুলো ঠিক করলে আউটপুট চলে আসবে।

আমার ডেটা কি সার্ভারে যায়?

না, সব ব্রাউজারে হয়। তবে শেষ ইনপুটটা এই ব্রাউজারে সেভ থাকে, শেয়ার করা কম্পিউটারে কাজ শেষে Clear চাপুন।

Questions people ask · প্রশ্ন ও উত্তর

How do I check whether my JSON is valid?

Paste it in. If it parses, formatted output appears; if not, the output box is replaced by an error message from your browser's JSON parser, which usually mentions the position of the problem.

Why is my JSON invalid when it works in JavaScript?

JavaScript object syntax allows single quotes, unquoted keys, comments and trailing commas; JSON does not. Use double quotes for every key and string and remove the extras.

What is the difference between minify and escape?

Minify removes whitespace but keeps it as JSON. Escape wraps the whole text in quotes and backslash-escapes the inner quotes and line breaks, turning it into a single string value.

Can I use tabs for indentation?

Not at the moment. The dropdown has a tab-style entry, but it produces the same 2-space indentation; choose 2 or 4 spaces.

Is my JSON uploaded?

No. Parsing and formatting run in your browser. Note that your last input is saved in the browser's local storage on this device, so press Clear when you finish with sensitive data on a shared computer.

Is there a size limit?

There is no fixed limit, but very large files can make typing sluggish because the page re-checks the whole input each time it changes.

More like this in Free tools. Need a version built for your business? Ask us.