JSON
JSON Formatter / Minify / Validator
JSON की फ़ॉर्मेटिंग (2-स्पेस इंडेंट), मिनिफ़ाई और वैलिडेशन सीधे ब्राउज़र में।
JSON Formatter turns any JSON into a readable, indented form, compresses it into a single compact line, or checks it for syntax errors. Everything runs in your browser — nothing you paste is sent anywhere.
How to use it
- Format: paste JSON into the input — a 2-space indented result appears immediately.
- Minify: switch to Minify mode to get compact JSON with no whitespace, ready to embed in code or send over the network.
- Validate: if the JSON is invalid, the tool points to the exact line and character where the syntax error occurs.
Common uses
- Reading an API response that arrived as one long unbroken line.
- Checking configuration files (package.json, tsconfig.json, etc.) before a commit.
- Minifying JSON before pasting it into an environment variable or a one-line config.
Things to keep in mind
Formatting never changes data types or key order — only the whitespace and line breaks around values.
Valid JSON doesn't allow trailing commas, comments, or single quotes — if your input has those, run it through JSON Repair first.
इस टूल के बारे में लेख: JSON Formatter: फ़ॉर्मेटिंग, मिनिफिकेशन और वैलिडेशन
अक्सर पूछे जाने वाले प्रश्न
यह टूल क्या करता है और कब इस्तेमाल करें?
यह JSON को 2-स्पेस इंडेंट के साथ फ़ॉर्मेट करता है ताकि पढ़ने में आसान हो, स्पेस हटाकर मिनिफ़ाई करता है, या सिंटैक्स वैलिडेट करता है। किसी API रिस्पॉन्स को डीबग करने या कमिट से पहले कॉन्फ़िग फ़ाइल साफ़ करने के लिए उपयोगी।
क्या मेरा JSON डेटा किसी सर्वर पर भेजा जाता है?
नहीं, सब कुछ आपके ब्राउज़र में JavaScript से होता है — कोई भी डेटा किसी सर्वर पर नहीं भेजा जाता।
मेरे JSON में आख़िरी एलिमेंट के बाद कॉमा होने पर एरर क्यों आती है?
Trailing comma (आख़िरी एलिमेंट के बाद कॉमा) मान्य JSON नहीं है, भले ही JavaScript जैसी कुछ भाषाएं इसे ऑब्जेक्ट/ऐरे लिटरल में स्वीकार कर लें। वैलिडेट करने से पहले इसे हटाएं। ध्यान रहे, मिनिफ़ाई सिर्फ़ टोकन्स के बीच की स्पेस हटाता है, स्ट्रिंग वैल्यू के अंदर के कैरेक्टर्स को कभी नहीं छूता।
JSON5 या JSONC स्टैंडर्ड JSON से कैसे अलग है?
यह एक्सटेंशन हैं, जो अतिरिक्त रूप से कमेंट्स, trailing comma और बिना कोट वाली कुंजियों की अनुमति देते हैं। एक सख्त JSON वैलिडेटर (इस टूल की तरह) ऐसे टेक्स्ट को सही तरीक़े से रिजेक्ट करेगा — इसके लिए ऐसे अलग पार्सर की ज़रूरत होती है जो स्पष्ट रूप से JSON5/JSONC सपोर्ट करता हो।
क्या फ़ॉर्मेटिंग डेटा टाइप्स बदल देती है, जैसे संख्याएँ?
नहीं, फ़ॉर्मेटिंग और मिनिफिकेशन सिर्फ़ वैल्यू के आसपास स्पेस और लाइन ब्रेक को व्यवस्थित करते हैं। संख्याएँ, स्ट्रिंग, बूलियन वैल्यू और null अपने मूल रूप में ही रहते हैं।