Free online JSON array flattener. Just load your nested JSON array in the input field and it will automatically get converted into a flat, single-level array. In the tool options, you can also change the depth of flattening and control how many levels of nested arrays should be removed. Additionally, you can customize the format of the flattened array by changing its output format. It can be minified or indented with spaces or tabs. Created for developers by developers from team Browserling.
Free online JSON array flattener. Just load your nested JSON array in the input field and it will automatically get converted into a flat, single-level array. In the tool options, you can also change the depth of flattening and control how many levels of nested arrays should be removed. Additionally, you can customize the format of the flattened array by changing its output format. It can be minified or indented with spaces or tabs. Created for developers by developers from team Browserling.
This tool converts multiple nested JSON arrays into a flat list. This process is called flattening and it's a data structure transformation that converts a multi-level data structure (such as an array of arrays) into a single-level one (such as just an array or a list). It can be used to simplify the analysis and processing of data as after flattening, the data becomes single-dimensional. The tool only works with arrays, so make sure that your input data is a valid JSON array and not some other data type. This program also offers several options to adjust the conversion process. In particular, the "Flatten Depth" option determines how many levels of nested arrays should be traversed and converted into a flat list. For example, if you have a three-dimensional array ["a", ["b", ["c"]]] and you enter a depth of 1, then your array's dimension will be reduced by one and it will turn into a two-dimensional array ["a", "b", ["c"]]. Similarly, if you enter a depth of 2, then it will turn into a one-dimensional, flat array ["a", "b", "c"]. You can think about the depth option as to how many dimensions to remove from the original array. To cover all cases and convert deeply nested arrays into a flat one, enter the asterisk "*" symbol in the depth option. This option will make the tool travel the full depth of the array recursively and output a flat list. Another set of options allows you to customize the format of the output array. You can add indentation to the JSON array via spaces or tabs, and also specify the number of spaces used for each level of indentation. Or, you can create a compact, minified JSON array without indentation or extra spaces between array elements. If you're working with JSON objects and not arrays, and you need to flatten them and create JSON properties-like data structure, you can use our Flatten a JSON Object tool. Json-abulous!
This tool converts multiple nested JSON arrays into a flat list. This process is called flattening and it's a data structure transformation that converts a multi-level data structure (such as an array of arrays) into a single-level one (such as just an array or a list). It can be used to simplify the analysis and processing of data as after flattening, the data becomes single-dimensional. The tool only works with arrays, so make sure that your input data is a valid JSON array and not some other data type. This program also offers several options to adjust the conversion process. In particular, the "Flatten Depth" option determines how many levels of nested arrays should be traversed and converted into a flat list. For example, if you have a three-dimensional array ["a", ["b", ["c"]]] and you enter a depth of 1, then your array's dimension will be reduced by one and it will turn into a two-dimensional array ["a", "b", ["c"]]. Similarly, if you enter a depth of 2, then it will turn into a one-dimensional, flat array ["a", "b", "c"]. You can think about the depth option as to how many dimensions to remove from the original array. To cover all cases and convert deeply nested arrays into a flat one, enter the asterisk "*" symbol in the depth option. This option will make the tool travel the full depth of the array recursively and output a flat list. Another set of options allows you to customize the format of the output array. You can add indentation to the JSON array via spaces or tabs, and also specify the number of spaces used for each level of indentation. Or, you can create a compact, minified JSON array without indentation or extra spaces between array elements. If you're working with JSON objects and not arrays, and you need to flatten them and create JSON properties-like data structure, you can use our Flatten a JSON Object tool. Json-abulous!
In this example, we load a JSON array containing three subarrays, each filled with animal names. As the main (outer) array contains subarrays, the dimension of this data structure is two, so it's a two-dimensional array. The tool flattens this structure and displays all animals ("cat", "dog", "bird", "fish", "mouse", "raccoon") in a single, one-dimensional array, making it easier to iterate and process the data. We also change the format of the output JSON array by adding tabs for indentation.
In this example, we flatten a JSON array representing a pizza recipe. The array includes a list of ingredients nested in arrays at different levels. By setting the recursion depth option to 2, we flatten the first and second nested JSON arrays. As a result, the original four-dimensional array gets converted to a two-dimensional array.
In this example, we fully flatten a deeply nested numerical array. The input JSON contains a list of the first eight prime numbers, where each subsequent number forms a new nested array, thus creating a right-leaning 8-dimensional array. To quickly convert this array into a one-dimensional array, we enter the asterisk symbol "*" in the depth option. The asterisk matches the maximum array depth and makes the program output a flat list. Additionally, the output list is minified to save space.
You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!
Find keys and/or values that interest you in a JSON file.
Create a text list from a JSON array or object.
Create a JSON array from a text list.
Generate HTTP form data from a JSON object.
Generate JSON object from HTTP form data.
Create a HTML table from keys and values of a JSON object.
Convert a JSON file to a CSON file.
Convert a CSON file to a JSON file.
Convert a JSON config to a TOML config.
Convert a TOML file to a JSON file.
Convert a JSON data structure to Bencode encoding.
Convert Bencode data to JSON data.
Convert a JSON file to a JSONL file.
Convert a JSONL file to a JSON file.
Convert binary JSON data structure (BSON) to JSON.
Convert a JSON file to a universal binary JSON (UBJSON).
Convert universal binary JSON (UBJSON) to regular JSON.
Serialize JSON data to binary MessagePack format.
Unserialize binary MessagePack to a JSON struct.
Serialize JSON data to binary Protobuf format.
Unserialize binary Protobuf to a JSON struct.
Generate a LaTeX table from a JSON object.
Convert a JSON data file to an INI configuration file.
Convert an INI configuration file to JSON data file.
Loop over JSON structure and truncate all values or keys.
Find the nesting depth of a JSON data structure.
Convert a JSON data structure to a data URL.
Create a PHP data structure from a JSON data structure.
Create a JSON data structure from a PHP data structure.
Diff JSON files and show differences visually.
Lexicographically sort the order of JSON object keys.
Exchange keys with values in a JSON file.
Create a JSON array with random values.
Create a JSON object with random keys and values.
Randomly change the positions of array elements.
Randomly change the order of key, value pairs.
Add random spaces and newlines in a JSON file.
Tokenize a JSON data structure.
Remove all JSON syntax and leave just the values.
Change curly braces, commas, and quotes to other symbols.
Fix incorrectly quoted (usually single quote) keys and values.
Make all keys and values in a JSON to be single-quoted.
Make all keys and values in a JSON to be double-quoted.
Create JSON that looks real but is fake (FakeSON).
Execute a jq query on a JSON data structure.
Filter keys and values that match a pattern.
Create a JSON array from a string.
Create groups of JSON array items.
Merge two or more JSON arrays together.
Find differences in two or more JSON arrays.
Merge two or more JSON objects together.
Introduce errors in a JSON data structure.
Try to fix a damaged JSON to the best of our ability.
Convert images to valid JSON strings that look like ASCII art.
Create an abstract visualization of JSON's complexity.
Subscribe to our updates. We'll let you know when we release new tools, features, and organize online workshops.
Enter your email here
We're Browserling — a friendly and fun cross-browser testing company powered by alien technology. At Browserling, our mission is to make people's lives easier, so we created this collection of JSON tools. Our tools have the simplest user interface that doesn't require advanced computer skills and they are used by millions of people every month. Behind the scenes, all JSON tools are actually powered by our web developer tools that we created over the last couple of years. Check them out!