Free Toolkit

Properties to JSONConvert Java .properties files to structured JSON with nested key support.

Properties to JSON illustration
๐Ÿ”„

Properties to JSON

Convert Java .properties files to structured JSON with nested key support.

How to Use
1

Paste .properties content

Paste your Java properties file content.

2

View JSON

Dotted keys become nested JSON objects automatically.

3

Copy JSON

Copy the structured JSON output.

What Is Properties to JSON?

Properties to JSON converts Java-style .properties files into structured JSON format. Properties files use simple key=value or key:value syntax and are commonly used for Java application configuration, i18n message bundles, and Spring Boot settings. This converter supports dotted keys (e.g., db.host=localhost) which are expanded into nested JSON objects. It handles # and ! comment styles, escape sequences (\n, \t), and both = and : separators.

Why Use Our Properties to JSON?

  • Dotted keys automatically expanded into nested JSON objects.
  • Supports both = and : key-value separators.
  • Handles Java escape sequences (\n, \t, \\).
  • Supports # and ! comment styles.

Common Use Cases

Spring Boot Migration

Convert application.properties to JSON for use with other frameworks.

i18n Processing

Transform Java message bundle .properties files into JSON for JavaScript i18n libraries.

Configuration Analysis

Convert properties files to JSON for programmatic processing and analysis.

DevOps

Parse application configuration into JSON for infrastructure automation.

Technical Guide

The parser processes the properties file line by line. Lines starting with # or ! are treated as comments and skipped. Empty lines are ignored. Key-value separation supports both = and : delimiters. The parser finds the first occurrence of either delimiter and splits the line there. Both key and value are trimmed of whitespace. Dotted key expansion: keys containing periods (e.g., db.connection.host) are split and create nested JSON objects. The parser walks the key parts, creating intermediate objects as needed, and sets the value at the deepest level. Escape sequences are processed: \n becomes newline, \t becomes tab, \\ becomes backslash. This matches Java's Properties file escape handling.

Tips & Best Practices

  • 1
    Dotted keys (a.b.c) create nested JSON: {"a":{"b":{"c":"value"}}}.
  • 2
    Both = and : separators are supported for key-value pairs.
  • 3
    Comments with # or ! are ignored during parsing.
  • 4
    Java escape sequences (\n, \t) are properly unescaped.

Related Tools

Frequently Asked Questions

QHow are dotted keys handled?
Keys with dots are expanded into nested JSON objects. For example, db.host=localhost becomes {"db":{"host":"localhost"}}.
QWhich separators are supported?
Both = and : are supported as key-value separators.
QAre escape sequences processed?
Yes, standard Java escape sequences (\n, \t, \\) are unescaped.
QWhat about multi-line values?
Standard line continuation with trailing backslash is not supported. Each key-value pair should be on one line.
QAre Unicode escapes handled?
Java \uXXXX Unicode escapes are not currently processed. Values are treated as UTF-8 text.

About Properties to JSON

Properties to JSON is a free online tool from FreeToolkit.ai. All processing happens directly in your browser โ€” your data never leaves your device. No registration required. No ads. Just fast, reliable tools.