How to use
- Copy your data from Google Sheets.
- Paste the data into the input field.
- Copy or Download your JSON output.
Using the JSON Output
Once you have your JSON output, you can easily copy it as a JSON string or as a JavaScript object for direct use in your code.
JSON (pretty) - Pretty printed JSON with indentation and whitespace for better readability. This is useful for debugging and understanding the structure of the data.
JSON - Compact JSON without extra whitespace. This is useful for saving space and for use in production code.
Mastering Sheets to JSON
Learn how to use this tool to its full potential with these tips. Choosing the right mode is key to getting the results you need. Use the Mode option to choose whether your data is represented as an array or a keyed object. This flexibility allows you to format the JSON output according to your specific requirements. The following modes are supported:
- Objects - Use this mode to create an array of objects with keys and values. Each row in your data will be represented as an object with keys and values. The keys are taken from the first row (header) of your data.
- Array - Use this mode to create an array of arrays. Each row in your data will be represented as an array of values. This mode is useful when you want to keep the data in a simple array format.
- Single Array - This mode will create a single flat array of values. This is most relevant when you have a single column of data. If you have multiple columns, the data will be flattened, and all your data will be in a single array.
- Indexed Objects - This mode is similar to the Objects mode, but it will create a single object, keyed by the first column. Each of these will be an object with keys and values. The keys are taken from the first column (header) of your data.
- Indexed Array - This will create an object, indexed by the first column, where the rest of the columns are represented as an array.
- Key-Value Pairs - This mode will create an object with key-value pairs. The keys are taken from the first column, and the values are taken from the second column. If your data has more than two columns, the additional columns will be ignored.
Additional Options
- Filtering - Use the filter option to whitelist or blacklist keys from your data. If you choose to blacklist keys, only the keys you specify will be removed from the output. For example, you might want to exclude a key named password from the output. If you choose to whitelist keys, only the keys you specify will be included in the output.
- Advanced Options > Delimiters - Use the advanced options to further customize how this tool works. You can specify non-standard delimiters for your data. For example, changing the column delimiter to ,, effectively turns this into a CSV to JSON converter.
- Advanced Options > Trimming - Specify custom trim characters to clean your data. Adding trimming can help remove unwanted whitespace from your data.
- Advanced Options > Sorting - Sort your keys or arrays alphabetically or numerically. Although this is relatively easy to prepare in Google Sheets before you copy, this option can still be useful if you need it.
Privacy and Security
We take your privacy and security seriously. We also have absolutely no interest in storing or tracking anything that you paste or type into this tool. This tools logic for manipulating data runs entirely in your browser and does not send any data to our servers. Your data stays on your own device and is not accessible to anyone but yourself.
Definitions
- JSON
- JavaScript Object Notation, a lightweight data-interchange format that is easy for humans to read and write and easy for machines to parse and generate.
- Key
- An identifier for a value in a key-value pair within a JSON object.
- Array
- An ordered list of values in JSON.
- Object
- A collection of key-value pairs in JSON.
- Mode: Objects
- Creates an array of objects. Keys are taken from the first row. Values taken from the rest of the rows.
- Mode: Arrays
- Creating an array of arrays. Each row is represented as an array of values.
- Mode: Indexed Objects
- Creates an object of objects. The main objects keys are taken from the first column and its values are sub-objects. The sub-objects keys are taken from the first row. The the sub-objects values are taken from the rest of the rows.
- Mode: Single Array
- Creates a single flat array of values.
- Mode: Indexed Array
- Creates an object of arrays. The main objects keys are taken from the first column and its values are arrays. The arrays values are taken from the rest of the columns.
- Mode: Key-Value Pairs
- Creates an object of key-value pairs. The keys are taken from the first column and the values are taken from the second column.
- Pretty Print
- Formatting JSON to be more readable by adding whitespace and indentation.
- Compact JSON
- Formatting JSON to be more compact by removing whitespace and indentation.
- Whitelist
- Include only the spicified values or keys.
- Blacklist
- Exclude the specified values or keys. Include everything else.
- Auto-detect
- Automatically detect the data type of each column.
Why we created this tool
As developers, we often convert data between several formats. Collecting initial data in google sheets is a common theme, as we need to be able to manipulate, edit and view data in a user-friendly way. However, when it comes to using this data in our code, we often transfer such data to a database or hard-code it in our code. This is where this tool comes in handy. It allows us to quickly convert our gathered data from Google Sheets to JSON format, which is a common format supported by most programming languages and databases.
We created Sheets to JSON because we couldn't find a simple and effective tool for quickly converting Google Sheets data to JSON format. We found ourselves rewriting the same helper functions over and over again for each project. arrayOfArraysToJSONObjects() , arrayOfArraysToJSONArrays() , etc. This tool does all that for you, and more, in a simple copy and paste workflow.
Features
- Simple yet advanced - Choose from various formatting options to create the JSON structure that fits your needs.
- Fast - Convert your data instantly. Just copy, paste, and get your JSON.
- Fast - Our Sheets to JSON is fast. Start now and instantly get JSON. Just copy your data from Google Sheets and get the JSON.
- Easy - Sometimes you just need a simple tool with no fuss. Our Sheets to JSON is just that. But for those times when you need more, it also has powerful features such as custom keys and array or object format.
- Modern - Our Sheets to JSON is built in Next 13, with Material 3 design and served on blazingly fast Vercel edge servers.
- Ad free - Our Sheets to JSON is free from ads. Many other tools are cluttered with ads, but not this one.
- Free for life - Our Sheets to JSON is free to use forever.
Contribute and Share
We are always looking to improve. If you have any feedback or suggestions, please use the feedback button to let us know. We read every feedback and use it to improve this tool.
Share your results with your friends and colleagues. Click and share a link to this tool and optionally include your input and settings as well.
Coming Soon
We are constantly improving this tool. Here are some of the features we have planned for future implementation:
- Support for Auto-detect data types in more modes. Currently only the Objects mode supports auto-detecting data types. We plan to extend this feature to other modes as well.
- Filtering of rows. Currently, you can only filter keys. We plan to extend this feature to allow filtering of rows as well. That could include filtering out based on key or column bound rules.
- Post manipulation of data. We plan to add options to manipulate the data after it has been converted to JSON. This could include replacing values, adding suffixes and prefixes, and more.
- Option to force parsing of specific keys cell values as objects. Auto-detection could also be supported here. Either the user can choose which keys should try to be treated as objects, or the tool can try to detect this automatically by testing cell values for starting and ending with { and } characters.
- Option to support parsing specific keys cell values as arrays. For example, if a cell contains a comma-separated list, it will be parsed as an array. Additionally user should be able to choose their delimiter for the cell array. Auto-detection could also be supported here, although it is unusual to begin and end a cell value with [ and ].
- Option to support parsing specific keys cell values as dates. For example, if a cell contains a date, it will be parsed as a date object. Auto detect and manual key selection should be supported.
- Option to support parsing specific keys cell values as numbers. For example, if a cell contains a number, it will be parsed as a number object. Auto detect and manual key selection should be supported.
If you want to see any of these features quicker, please let us know by using the feedback button.
Updates
2024-05-17
Initial release