# Properties to JSON Converter

Convert Java Properties file format to JSON

> Canonical page: https://elysiatools.com/en/tools/properties-to-json

- **Category:** Format Conversion

- **Keywords:** properties, json, convert, java, config, properties file

## Overview

The Properties to JSON Converter is a streamlined utility designed to transform Java Properties files into structured JSON format, making it easier to integrate legacy configuration files into modern web applications and APIs.

## Inputs

- **Properties Input** (textarea): Enter properties content... database.url=jdbc:mysql://localhost:3306/mydb database.username=admin database.password=secret
- **Ignore Comment Lines** (checkbox)
- **Trim Whitespace from Values** (checkbox)
- **Create Nested Objects from Dotted Keys** (checkbox)

## When to use

- Migrating application configuration from Java-based environments to JavaScript or Node.js projects.
- Standardizing configuration formats for better compatibility with modern cloud-native deployment tools.
- Quickly parsing flat key-value pairs into hierarchical JSON objects for easier data manipulation.

## How it works

- Paste your raw Java Properties content into the input area.
- Select your preferred formatting options, such as enabling nested object creation from dotted keys.
- Click the convert button to generate the equivalent JSON structure instantly.
- Copy or download the resulting JSON for use in your project.

## Use cases

- Converting legacy Java application properties into JSON for use in microservices.
- Standardizing environment variables stored in properties files for frontend configuration.
- Refactoring flat configuration files into organized, hierarchical JSON structures.

## Frequently asked questions

### Can this tool handle nested keys?

Yes, by enabling the 'Create Nested Objects from Dotted Keys' option, keys like 'app.server.port' will be converted into a nested JSON object structure.

### Does it strip out comments?

Yes, you can toggle the 'Ignore Comment Lines' option to automatically remove any lines starting with '#' or '!' from your output.

### Will it clean up whitespace?

Yes, the 'Trim Whitespace from Values' option ensures that leading and trailing spaces are removed from your configuration values.

### Is this tool secure?

The conversion process happens locally in your browser, ensuring your configuration data is not uploaded to any server.

### What happens if my properties file is empty?

The tool will return an empty JSON object '{}' if no valid key-value pairs are detected in the input.

## Related tools

- [BSON Converter](https://elysiatools.com/en/tools/bson-converter): Encode and decode data to/from BSON (Binary JSON) format
- [CSON to JSON Converter](https://elysiatools.com/en/tools/cson-to-json): Convert CSON (CoffeeScript Object Notation) data to JSON format
- [EDN to JSON Converter](https://elysiatools.com/en/tools/edn-to-json): Convert EDN (Extensible Data Notation) data to JSON format
- [GeoJSON to GPX Converter](https://elysiatools.com/en/tools/geojson-to-gpx): Convert GeoJSON format to GPX (GPS Exchange Format) format
- [GeoJSON to KML Converter](https://elysiatools.com/en/tools/geojson-to-kml): Convert GeoJSON format to KML (Keyhole Markup Language) format
- [GeoJSON to OSM Converter](https://elysiatools.com/en/tools/geojson-to-osm): Convert GeoJSON format to OpenStreetMap (OSM) XML format
- [GPX to GeoJSON Converter](https://elysiatools.com/en/tools/gpx-to-geojson): Convert GPX (GPS Exchange Format) to GeoJSON format
- [GraphQL to JSON Converter](https://elysiatools.com/en/tools/graphql-to-json): Convert GraphQL query or response data to JSON format

## Samples

- [JSON Samples](https://elysiatools.com/en/samples/json): JSON (JavaScript Object Notation) format examples from simple to complex structures
- [Terraform Plan JSON Samples](https://elysiatools.com/en/samples/terraform-plan-json-samples): Sample Terraform plan JSON files exported from terraform show -json style payloads for dependency visualization and change review
- [Chat Transcript JSON Samples](https://elysiatools.com/en/samples/chat-transcript-json): JSON examples for multi-role chat transcripts
- [Rich Media JSON Samples](https://elysiatools.com/en/samples/rich-media-json): JSON examples for popular rich text editors (TipTap, Quill, Slate)

## Related content

- [Environment and Configuration Format Workflow](https://elysiatools.com/en/hubs/config-workflows): Inspect, validate, convert, merge, and diff configuration without exposing secrets or losing the source of truth.
