Categories

JSON Unflattener

Convert flattened key-value pairs back to nested JSON objects with support for different key formats and data type inference

Key Facts

Category
Data Processing
Input Types
textarea, select, text, checkbox
Output Type
json
Sample Coverage
4
API Ready
Yes

Overview

The JSON Unflattener tool allows you to instantly convert flattened key-value pairs or dot-notation strings back into structured, nested JSON objects. It is designed to help developers and data analysts reconstruct complex data hierarchies from flat exports, CSVs, or configuration files with ease.

When to Use

  • Reconstructing nested JSON objects from flat database exports or CSV files.
  • Converting dot-notation configuration strings into readable hierarchical JSON structures.
  • Standardizing inconsistent data formats by parsing flattened keys into a clean, nested schema.

How It Works

  • Paste your flattened data into the input area and select your input format (JSON or Key=Value).
  • Choose the appropriate key format (e.g., Dot Notation, Bracket, or Path) to match your input structure.
  • Configure data type inference and array detection settings to ensure the output matches your expected schema.
  • Click process to generate and download your fully nested, structured JSON object.

Use Cases

Transforming flat environment variable exports into nested application configuration files.
Rebuilding complex API response objects from flattened log data for debugging purposes.
Cleaning up exported spreadsheet data that uses dot-notation headers to represent nested object properties.

Examples

1. Reconstructing User Profiles

Backend Developer
Background
I received a flat list of user attributes from a legacy database export where keys were stored as 'user.profile.name' and 'user.profile.age'.
Problem
The application requires a nested JSON object to process the user data correctly.
How to Use
Input the key-value pairs, set the Key Format to 'Dot Notation', and select 'Auto' for data type inference.
Example Config
Input Format: Key=Value, Key Format: Dot Notation, Type Inference: Auto
Outcome
The tool outputs a clean, nested JSON object: { "user": { "profile": { "name": "John", "age": 30 } } }.

2. Parsing Configuration Arrays

DevOps Engineer
Background
I have a flat list of server settings using bracket notation like 'servers[0].ip' and 'servers[1].ip'.
Problem
I need to convert these flat strings into a structured JSON array for a deployment script.
How to Use
Paste the lines, set Key Format to 'Bracket', and enable 'Bracket Keys' in the Array Detection settings.
Example Config
Input Format: Key=Value, Key Format: Bracket, Array Detection: Bracket Keys
Outcome
The tool generates a valid JSON array containing the server objects, ready for use in the deployment pipeline.

Try with Samples

json

Related Hubs

FAQ

What input formats are supported?

You can provide input as a flat JSON object or as a list of Key=Value pairs, one per line.

How does the tool handle arrays?

The tool supports numeric keys (e.g., user.0, user.1) or bracket notation (e.g., user[0], user[1]) to automatically detect and reconstruct arrays.

Can it automatically detect data types?

Yes, the 'Auto-detect' and 'Smart' inference modes automatically convert strings into numbers, booleans, or null values where applicable.

What happens if there are conflicting keys?

You can choose a merge strategy: override the existing value, merge objects/arrays, or trigger an error if a conflict is detected.

Is my data processed on a server?

The tool performs processing locally in your browser, ensuring your data remains private and secure.

API Documentation

Request Endpoint

POST /en/api/tools/json-unflattener

Request Parameters

Parameter Name Type Required Description
dataInput textarea Yes -
inputFormat select Yes -
keyFormat select Yes -
delimiter text No -
typeInference select Yes -
arrayMode select Yes -
mergeStrategy select Yes -
preserveEmpty checkbox No -

Response Format

{
  "key": {...},
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
JSON Data: JSON Data

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-json-unflattener": {
      "name": "json-unflattener",
      "description": "Convert flattened key-value pairs back to nested JSON objects with support for different key formats and data type inference",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=json-unflattener",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]