JSON/YAML Empty Values

A simple, fast and free online tool to set all values in JSON/YAML objects to empty defaults

Input JSON/YAML

Configuration

Input Format

Empty Value Types

Output Format

Output

How to Use

  1. Enter or paste your JSON/YAML data in the input field.
  2. Select the input format (JSON or YAML).
  3. Choose how you want empty values to be represented:
    • Default empty values: Uses appropriate empty value based on type (null, "", [], {})
    • All null: Sets all values to null
    • All empty string: Sets all values to empty string ("")
  4. Select your desired output format (JSON or YAML).
  5. Click "Set Empty Values" to process your data.
  6. Use "Copy to Clipboard" or "Download File" to save your result.

Examples

Default Empty Values

Input:

{
  "name": "John",
  "age": 30,
  "address": {
    "city": "New York"
  },
  "hobbies": ["reading"]
}

Output:

{
  "name": "",
  "age": 0,
  "address": {},
  "hobbies": []
}

All Null Values

Input:

name: John
age: 30
address:
  city: New York
hobbies:
  - reading

Output:

name: null
age: null
address:
  city: null
hobbies:
  - null

About JSON/YAML Empty Values Tool

This tool helps you create templates or anonymize data structures by setting all values to empty defaults while preserving the original structure. It's particularly useful for:

The tool supports both JSON and YAML formats and provides various options for empty value representation, making it flexible for different use cases.

Related Tools