Diysb Tools

Validar JSON

Verifique se JSON é válido e bem formado.

Ferramentas JSON

O que é validação JSON?

JSON (JavaScript Object Notation) é um formato leve para troca de dados. A validação JSON garante que a estrutura dos dados esteja em conformidade com o padrão JSON. Um objeto JSON válido deve ter: - Nomes de propriedades entre aspas duplas. - Chaves chaves devidamente balanceadas. - Sem vírgulas finais após o último par chave-valor. - Aninhamento correto de objetos e matrizes. Esta ferramenta verifica o JSON de entrada e fornece feedback para ajudar a identificar e corrigir erros comuns.

Entrada JSON
Resultado da Validação
Validar JSON Exemplos

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