Convert JSON to Properties

Drag and drop files here or click to select.
Max file size 100mb.
Uploading progress:

JSON vs Properties Format Comparison

Aspect JSON (Source Format) Properties (Target Format)
Format Overview
JSON
JavaScript Object Notation

Lightweight data interchange format that is easy for humans to read and write and easy for machines to parse and generate. Based on a subset of JavaScript, JSON has become the universal standard for web APIs, configuration files, and data storage.

Data Format Universal Standard
Properties
Java Properties File

Simple key-value configuration format used extensively in Java and Spring Boot applications. Each line contains a key=value or key:value pair. Nested keys use dot notation (app.server.port=8080). Properties files are the standard configuration mechanism for the entire JVM ecosystem.

Configuration Java Standard
Technical Specifications
Standard: RFC 8259 / ECMA-404
Encoding: UTF-8 (mandatory)
Format: Text-based with strict syntax
Data Types: String, Number, Boolean, Array, Object, null
Extension: .json
Standard: Java SE specification (java.util.Properties)
Encoding: ISO 8859-1 (Latin-1), Unicode escapes (\uXXXX)
Format: Line-based key=value or key:value pairs
Data Types: Strings only (all values are text)
Extension: .properties
Syntax Examples

JSON uses braces and brackets:

{
  "name": "My Project",
  "version": "2.0",
  "features": ["fast", "free"],
  "database": {
    "host": "localhost",
    "port": 5432
  }
}

Properties uses dot-separated keys:

# Application configuration
name=My Project
version=2.0
features[0]=fast
features[1]=free
database.host=localhost
database.port=5432
Content Support
  • Key-value pairs (objects)
  • Nested objects
  • Arrays (ordered lists)
  • Strings, numbers, booleans, null
  • No comments support
  • No trailing commas
  • Strict syntax rules
  • Key-value pairs (one per line)
  • Dot notation for nested keys (a.b.c=value)
  • Comments using # or !
  • Unicode escape sequences (\uXXXX)
  • Line continuation with backslash (\)
  • No sections (flat namespace)
  • No native arrays or typed values
Advantages
  • Universal web standard
  • Native browser support
  • Strict, unambiguous parsing
  • Every programming language has JSON support
  • Ideal for APIs and data exchange
  • Compact representation
  • Native Java/Spring Boot support (java.util.Properties)
  • Simple, one-key-per-line format
  • Supports comments for documentation
  • Unicode escapes for international characters
  • Spring Boot auto-binding to @ConfigurationProperties
  • Easy to override with environment variables
Disadvantages
  • No comments allowed
  • Verbose for deeply nested data
  • No trailing commas
  • Keys must be quoted strings
  • Not human-friendly for large files
  • No native data types (everything is a string)
  • No hierarchical structure (flat keys only)
  • Default encoding is ISO 8859-1, not UTF-8
  • Array representation is non-standard
  • Primarily a Java ecosystem format
Common Uses
  • Web APIs (REST, GraphQL responses)
  • Configuration files (package.json, tsconfig.json)
  • Data storage and exchange
  • NoSQL databases (MongoDB, CouchDB)
  • Browser localStorage
  • Spring Boot configuration (application.properties)
  • Java resource bundles for i18n (messages.properties)
  • Apache configuration files
  • Gradle build properties (gradle.properties)
  • Log4j / Logback logging configuration
  • Android string resources
Best For
  • API communication
  • Web application data
  • Configuration management
  • Cross-platform data exchange
  • Java and Spring Boot application configuration
  • Internationalization and localization (i18n/l10n)
  • Build tool configuration (Maven, Gradle)
  • Simple key-value settings without nesting
Version History
Introduced: 2001 (Douglas Crockford)
Standard: RFC 8259 (2017), ECMA-404 (2013)
Status: Universal standard
Evolution: JS subset → RFC 4627 → RFC 7159 → RFC 8259
Introduced: 1995 (Java 1.0, java.util.Properties)
Major Update: Java 1.6 added XML properties support
Status: Standard in Java ecosystem, stable
Evolution: Java 1.0 Properties → Spring relaxed binding → Spring Boot profiles
Software Support
JavaScript: JSON.parse() / JSON.stringify() (built-in)
Python: json module (built-in)
Databases: MongoDB, PostgreSQL JSONB, MySQL JSON
Other: Every modern language has native JSON support
Java: java.util.Properties (built-in since JDK 1.0)
Spring: @Value, @ConfigurationProperties, Environment
Python: jproperties, configparser (similar)
Other: Apache Commons Configuration, Eclipse IDE, IntelliJ IDEA

Why Convert JSON to Properties?

Converting JSON files to Java Properties format is a common requirement when migrating configuration between modern web applications and the Java ecosystem. Spring Boot applications, for instance, use application.properties as their primary configuration file. If you have configuration data stored in JSON from a Node.js service, a REST API, or a cloud provider, converting it to .properties format lets you plug it directly into your Java or Spring Boot project.

Properties files use a flat key=value structure with dot notation for hierarchy. A JSON path like {"database": {"host": "localhost"}} becomes database.host=localhost in Properties format. This dot-separated convention is natively understood by Spring Boot's @ConfigurationProperties annotation, making it trivial to bind configuration values to Java beans. The format also supports comments (#) for documentation, something JSON cannot provide.

Our converter handles the flattening of nested JSON structures automatically. Each nested key path is joined with dots, arrays use indexed notation (items[0], items[1]), and all values are serialized as strings. The resulting .properties file is ready to use in any Java application, Spring Boot project, or build tool (Maven, Gradle) that reads this format.

Key Benefits of Converting JSON to Properties:

  • Spring Boot Ready: Output is directly usable as application.properties with auto-binding support
  • Flat Structure: Nested JSON objects are flattened to dot-notation keys (server.port=8080)
  • i18n Support: Perfect for generating localization resource bundles (messages_en.properties)
  • Build Tool Compatible: Works with Maven, Gradle, and Ant property files
  • Comment Support: Add # comments to document configuration values after conversion
  • Environment Override: Properties map directly to environment variable overrides in Spring Boot

Practical Examples

Example 1: Spring Boot Application Configuration

Input JSON file (config.json):

{
  "server": {
    "port": 8080,
    "servlet": {
      "context-path": "/api"
    }
  },
  "spring": {
    "datasource": {
      "url": "jdbc:mysql://localhost:3306/mydb",
      "username": "root",
      "password": "secret"
    }
  }
}

Output Properties file (application.properties):

# Server configuration
server.port=8080
server.servlet.context-path=/api

# Spring datasource configuration
spring.datasource.url=jdbc:mysql://localhost:3306/mydb
spring.datasource.username=root
spring.datasource.password=secret

Example 2: Internationalization Resource Bundle

Input JSON file (messages.json):

{
  "app": {
    "title": "My Application",
    "welcome": "Welcome, {0}!",
    "error": {
      "not_found": "Page not found",
      "forbidden": "Access denied",
      "server": "Internal server error"
    }
  }
}

Output Properties file (messages.properties):

app.title=My Application
app.welcome=Welcome, {0}!
app.error.not_found=Page not found
app.error.forbidden=Access denied
app.error.server=Internal server error

Example 3: Logging Configuration

Input JSON file (logging.json):

{
  "logging": {
    "level": {
      "root": "WARN",
      "com.myapp": "DEBUG",
      "org.springframework": "INFO"
    },
    "file": {
      "name": "app.log",
      "max-size": "10MB"
    }
  }
}

Output Properties file (application.properties):

logging.level.root=WARN
logging.level.com.myapp=DEBUG
logging.level.org.springframework=INFO
logging.file.name=app.log
logging.file.max-size=10MB

Frequently Asked Questions (FAQ)

Q: What is JSON format?

A: JSON (JavaScript Object Notation) is a lightweight data interchange format standardized as RFC 8259 and ECMA-404. It uses key-value pairs in objects (curly braces), ordered lists in arrays (square brackets), and supports strings, numbers, booleans, and null. JSON is the dominant format for web APIs, configuration files (package.json, tsconfig.json), and NoSQL databases like MongoDB.

Q: What is Java Properties format?

A: Java Properties (.properties) is a line-based key=value configuration format native to the Java ecosystem. It is loaded by java.util.Properties and used extensively in Spring Boot (application.properties), resource bundles for internationalization, and build tools like Maven and Gradle. All values are stored as strings, and nested keys use dot notation (parent.child.key=value).

Q: How are nested JSON objects handled?

A: Nested JSON objects are flattened using dot notation. For example, {"server": {"port": 8080}} becomes server.port=8080. This dot-separated format is the standard convention in Spring Boot and other Java frameworks, so the output is immediately usable without any additional transformation.

Q: How are JSON arrays converted?

A: JSON arrays are converted using indexed notation. For example, {"colors": ["red", "green", "blue"]} becomes colors[0]=red, colors[1]=green, colors[2]=blue. This is the same convention Spring Boot uses for list-type properties, so the output binds correctly to List fields in @ConfigurationProperties classes.

Q: What about special characters and Unicode?

A: Java Properties files use ISO 8859-1 encoding by default. Characters outside this range are represented as Unicode escape sequences (e.g., \u00E9 for e with acute accent). Our converter automatically handles this encoding, ensuring that international characters from your JSON data are correctly represented in the output.

Q: Can I use the output directly in Spring Boot?

A: Yes, the generated .properties file follows Spring Boot conventions and can be used directly as application.properties or application-{profile}.properties. The dot-notation keys, array indexing, and string values all match what Spring Boot expects for auto-configuration and @ConfigurationProperties binding.

Q: What happens if my JSON file has syntax errors?

A: If the JSON file contains syntax errors and cannot be parsed, the converter will treat the content as plain text and include it as commented-out lines in the .properties file. This ensures you always get output, even if the JSON is malformed, and you can then fix the original data and re-convert.