Diysb Tools

Validar JSON

Comprueba si JSON es válido y está bien formado.

Herramientas JSON

¿Qué es la validación JSON?

JSON (Notación de Objetos JavaScript) es un formato ligero de intercambio de datos. La validación de JSON garantiza que la estructura de los datos cumpla con el estándar JSON. Un objeto JSON válido debe tener: - Nombres de propiedad entre comillas dobles. - Llaves llaves correctamente equilibradas. - Sin comas finales después del último par clave-valor. - Anidamiento correcto de objetos y matrices. Esta herramienta revisa el JSON de entrada y proporciona información para ayudar a identificar y corregir errores comunes.

Entrada JSON
Resultado de la validación
Validar JSON Ejemplos

Valid JSON Object

This example shows a correctly formatted JSON object. All property names and string values are enclosed in double quotes, and the overall structure is properly balanced with opening and closing braces.

{ "name": "John", "age": 30, "city": "New York" }
{ "name": "John", "age": 30, "city": "New York" }
✅ Valid JSON
✅ Valid JSON

Invalid JSON Missing Quotes

This example demonstrates an invalid JSON object where the property names are not enclosed in double quotes. According to the JSON standard, property names must always be enclosed in double quotes. Omitting the quotes will result in a syntax error.

{ name: "John", age: 30, city: "New York" }
{ name: "John", age: 30, city: "New York" }
❌ Error: Expected property name or '}' in JSON
❌ Error: Expected property name or '}' in JSON

Invalid JSON with Trailing Comma

This example shows an invalid JSON object with a trailing comma after the last key-value pair. In JSON, trailing commas are not allowed because they create ambiguity when parsing the data structure.

{ "name": "John", "age": 30, "city": "New York", }
{ "name": "John", "age": 30, "city": "New York", }
❌ Error: Expected double-quoted property name
❌ Error: Expected double-quoted property name