Convert Properties to INI

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

Properties vs INI Format Comparison

Aspect Properties (Source Format) INI (Target Format)
Format Overview
Properties
Java Properties File

Plain text configuration format using key=value pairs, native to the Java platform. Properties files power Spring Boot configuration, Maven settings, i18n resource bundles, and JDBC connection parameters. Dotted notation (spring.datasource.url) creates logical hierarchies.

Key-Value Pairs Java Native
INI
Initialization File

Classic configuration format using sections enclosed in brackets and key=value pairs within each section. INI files originated in MS-DOS and Windows but are used across all platforms. Python's configparser, PHP's parse_ini_file, and many C/C++ applications natively support INI.

Sectioned Config Cross-Platform
Technical Specifications
Structure: Line-oriented key=value pairs
Encoding: ISO 8859-1 (Latin-1) / UTF-8
Format: java.util.Properties specification
Compression: None
Extensions: .properties
Structure: [Section] headers with key=value pairs
Encoding: UTF-8 / ASCII (implementation-dependent)
Format: No single formal specification
Compression: None
Extensions: .ini, .cfg, .conf
Syntax Examples

Flat key-value pairs with dotted names:

# Database
spring.datasource.url=jdbc:mysql://localhost/db
spring.datasource.username=root
spring.datasource.pool-size=10

# Server
server.port=8080
server.host=0.0.0.0

Sectioned configuration with brackets:

[spring.datasource]
url = jdbc:mysql://localhost/db
username = root
pool-size = 10

[server]
port = 8080
host = 0.0.0.0
Content Support
  • Key=value and key:value syntax
  • Dotted namespace hierarchies
  • Comment lines (# and !)
  • Multi-line values with backslash
  • Unicode escape sequences (\uXXXX)
  • Whitespace-separated pairs
  • Blank lines for grouping
  • [Section] headers for grouping
  • Key=value pairs within sections
  • Comment lines (; and #)
  • Multi-line values (implementation-dependent)
  • Subsections ([section.subsection])
  • Inline comments (some implementations)
  • Interpolation (Python configparser)
Advantages
  • Simple, human-readable format
  • Native Java API support
  • Spring Boot auto-configuration
  • Easy to parse and generate
  • Version control friendly
  • Environment-specific overrides
  • Explicit section grouping
  • Supported by Python, PHP, C/C++, .NET
  • Shorter key names (section provides context)
  • Visual separation of config groups
  • Windows Registry compatibility
  • Very simple parsing rules
Disadvantages
  • Flat structure (no nesting)
  • No data types (all strings)
  • Limited to Latin-1 without escapes
  • No array or list support
  • No standard schema validation
  • No standard specification
  • Limited nesting (typically one level)
  • No data types (all strings)
  • Implementation-dependent features
  • No array or list support (standard)
Common Uses
  • Java application configuration
  • Spring Boot settings
  • Internationalization resource bundles
  • Build tool configuration
  • Environment variable mapping
  • Windows application settings
  • Python application config (configparser)
  • PHP configuration (php.ini)
  • Git configuration (.gitconfig)
  • MySQL configuration (my.cnf)
  • systemd unit files
Best For
  • Java/Spring application settings
  • Simple key-value configuration
  • Locale-specific message bundles
  • Environment-based deployment configs
  • Cross-language configuration sharing
  • Platform-agnostic settings files
  • Simple sectioned configuration
  • Legacy application compatibility
Version History
Introduced: JDK 1.0 (1996)
Current Version: Part of java.util since Java 1.0
Status: Stable, widely used
Evolution: XML properties variant added in Java 5
Introduced: MS-DOS era (early 1980s)
Current Version: No formal versioning
Status: Ubiquitous convention
Evolution: Extended by various implementations
Software Support
Java: java.util.Properties (native)
Spring: @Value, @ConfigurationProperties
IDEs: IntelliJ, Eclipse, VS Code
Other: Apache Commons Configuration
Python: configparser (stdlib)
PHP: parse_ini_file() (native)
.NET: IniParser, various NuGet packages
Other: Boost.PropertyTree (C++), ini crate (Rust)

Why Convert Properties to INI?

Converting Java Properties files to INI format bridges the gap between the Java ecosystem and the broader world of application configuration. While .properties files are tightly coupled to Java's runtime, INI files are natively supported by Python (configparser), PHP (parse_ini_file), C/C++, .NET, and countless other languages and frameworks. This conversion is essential when migrating configurations between platforms or sharing settings across polyglot systems.

The most natural mapping between these formats leverages the dotted namespace convention in properties files. A property like spring.datasource.url naturally converts to an INI section [spring.datasource] with key url. This transformation makes the implicit hierarchy of properties files explicit through INI's bracket-delimited sections, resulting in a more organized and visually scannable configuration file.

For teams migrating from Java to Python or maintaining both Java and Python services, Properties-to-INI conversion ensures configuration consistency. A Spring Boot application.properties file can be converted to an INI file that Python's configparser reads natively, allowing both services to share the same configuration structure without maintaining duplicate files in different formats.

INI files also provide better visual organization than flat properties files. When a properties file contains hundreds of entries across dozens of namespaces, the sectioned INI format groups related settings together with clear [section] headers. This makes the configuration easier to navigate, review, and edit, particularly for team members who are not familiar with Java's dotted namespace conventions.

Key Benefits of Converting Properties to INI:

  • Cross-Language Compatibility: INI is supported by Python, PHP, C++, .NET, Ruby, and more
  • Explicit Sections: Dotted namespaces become clear [section] headers
  • Shorter Key Names: Section context eliminates prefix repetition in key names
  • Platform Migration: Move configuration from Java to Python/PHP/C++ projects
  • Better Readability: Sectioned format is easier to scan than flat key-value lists
  • Git Configuration: INI is the native format for .gitconfig and .gitmodules
  • Infrastructure Tooling: Ansible, systemd, and many DevOps tools use INI format

Practical Examples

Example 1: Spring Boot Config to Python-Compatible INI

Input Properties file (application.properties):

# Database Configuration
spring.datasource.url=jdbc:postgresql://db:5432/myapp
spring.datasource.username=app_user
spring.datasource.password=secret123
spring.datasource.hikari.max-pool=20

# Redis Cache
spring.redis.host=redis.internal
spring.redis.port=6379
spring.redis.database=0

# Logging
logging.level.root=INFO
logging.level.com.example=DEBUG
logging.file.name=app.log

Output INI file (config.ini):

; Database Configuration

[spring.datasource]
url = jdbc:postgresql://db:5432/myapp
username = app_user
password = secret123

[spring.datasource.hikari]
max-pool = 20

; Redis Cache

[spring.redis]
host = redis.internal
port = 6379
database = 0

; Logging

[logging.level]
root = INFO
com.example = DEBUG

[logging.file]
name = app.log

Example 2: Multi-Service Properties to INI

Input Properties file (services.properties):

# Payment Service
service.payment.url=https://api.stripe.com/v1
service.payment.api-key=sk_live_xxxxx
service.payment.timeout=5000

# Notification Service
service.notification.email.host=smtp.mailgun.org
service.notification.email.port=587
service.notification.sms.provider=twilio
service.notification.sms.api-key=ACxxxxx

Output INI file (services.ini):

; Payment Service

[service.payment]
url = https://api.stripe.com/v1
api-key = sk_live_xxxxx
timeout = 5000

; Notification Service

[service.notification.email]
host = smtp.mailgun.org
port = 587

[service.notification.sms]
provider = twilio
api-key = ACxxxxx

Example 3: Build Properties to INI for CI/CD

Input Properties file (build.properties):

# Project Info
project.name=my-webapp
project.version=2.5.1
project.group=com.example

# Build Settings
build.java.version=17
build.output.dir=target/classes
build.test.skip=false

# Deploy Targets
deploy.staging.host=staging.example.com
deploy.staging.port=22
deploy.production.host=prod.example.com
deploy.production.port=22

Output INI file (build.ini):

; Project Info

[project]
name = my-webapp
version = 2.5.1
group = com.example

; Build Settings

[build.java]
version = 17

[build.output]
dir = target/classes

[build.test]
skip = false

; Deploy Targets

[deploy.staging]
host = staging.example.com
port = 22

[deploy.production]
host = prod.example.com
port = 22

Frequently Asked Questions (FAQ)

Q: How are dotted property names converted to INI sections?

A: The converter analyzes each dotted property name and splits it into a section and key. For example, spring.datasource.url becomes section [spring.datasource] with key url. The converter intelligently determines the optimal split point to group related properties under the same section, keeping the INI file organized and readable.

Q: Can Python's configparser read the converted INI file?

A: Yes. The output follows the standard INI format that Python's configparser module reads natively. Section headers use [brackets], keys use the = separator, and comments use the ; prefix. You can read the converted file directly with configparser.ConfigParser().read('config.ini') and access values like config['spring.datasource']['url'].

Q: Are properties comments preserved?

A: Yes, comment lines from the properties file (lines starting with # or !) are converted to INI comments using the ; prefix. They are placed before the corresponding section they annotate, maintaining the documentation context. Note that INI comments use ; by convention, though # is also widely supported.

Q: What happens to properties without dotted names?

A: Properties without dots in their names (e.g., debug=true) are placed in a [DEFAULT] section at the top of the INI file. In most INI implementations, DEFAULT values are accessible from all sections, which mirrors the global nature of non-namespaced properties.

Q: How does this handle deeply nested namespaces?

A: Deeply nested properties like spring.datasource.hikari.connection-timeout are handled by using the last segment as the key and everything before it as the section name: [spring.datasource.hikari] with key connection-timeout. INI supports dotted section names, so the full hierarchy is preserved without losing information.

Q: Is the INI format standardized?

A: Unlike Properties (which has a Java specification), INI has no single formal standard. However, the core format ([section] + key=value) is universally supported. The converter produces conservative output compatible with all major INI parsers including Python's configparser, PHP's parse_ini_file, Boost.PropertyTree, and Windows API functions.

Q: Can I convert back from INI to Properties?

A: Yes, the conversion is reversible. INI sections and keys can be recombined into dotted property names (e.g., [server] + port becomes server.port). Our converter also supports INI to Properties conversion if you need to go in the other direction.

Q: How are Unicode values handled in the INI output?

A: Java Properties Unicode escapes (\uXXXX) are decoded into actual Unicode characters in the INI output. Since INI files are typically UTF-8 encoded, all Unicode characters are preserved directly. For example, \u00E9 becomes the literal e-acute character in the INI file.