Try it now: https://jsonformatter-gamma.vercel.app/
This is a React-based JSON Formatter tool that allows users to format JSON arrays by customizing key-value pair styles. The tool provides options to include or exclude double quotes for keys and numeric values.
- Accepts JSON input via a text area.
- Formats JSON output with the option to:
- Retain double quotes for keys and values.
- Remove double quotes from keys.
- Automatically remove quotes from numeric values.
- Copy the formatted JSON output to the clipboard.
- Node.js
- npm or yarn
- Clone this repository:
git clone <repository-url>
- Navigate to the project directory:
cd json-formatter-tool
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Enter a valid JSON array in the left text area.
- Use the dropdown menu in the middle column to choose the formatting style:
- Double Quotes: Retains quotes for both keys and values.
- No Quotes: Removes quotes from keys and numeric values.
- Click the Go button to generate the formatted JSON.
- View the formatted JSON in the right column.
- Use the Copy to Clipboard button to copy the output.
[
{"key1": "value1", "key2": 123},
{"key3": "value3", "key4": 456}
]
[
{key1: "value1", key2: 123},
{key3: "value3", key4: 456}
]
[
{"key1": "value1", "key2": 123},
{"key3": "value3", "key4": 456}
]
Tool.tsx
: Main component containing the logic for JSON formatting.index.css
: Tailwind CSS styles.App.tsx
: Entry point for the React application.
This project is licensed under the MIT License. See the LICENSE
file for details.
Contributions are welcome! Please fork the repository and create a pull request with your changes.