What is the PROPERTIES file format?
Files with the .properties extension are used by Java technology to store properties and configurable application parameters. They may also include strings for internationalisation and localisation, making them a standard format for i18n message bundles in Java applications and frameworks such as Spring.
Each line in a .properties file holds a single parameter. Each parameter is stored as a pair of strings - the first contains the name of the parameter (called a key) and the second contains its value. Keys and values are separated by =, :, or whitespace. Lines starting with # or ! are treated as comments and ignored by the parser. A trailing backslash (\) at the end of a line continues the value on the next line.
By default, .properties files are encoded in ISO-8859-1 (Latin-1). Non-Latin characters must be written as \uXXXX Unicode escape sequences - unlike YAML files or XML files, which natively support UTF-8. Java 9 introduced support for loading .properties files in UTF-8 when an explicit charset is provided.
Editing .properties files
.properties files can be freely modified with any text editor. However, more advanced tools for file editing are also available, equipped with additional functions not supported by regular text editors. Using these tools enables:
- data validation
- creating new keys
- synchronising names of keys across locale files
- automatic, two-way conversion of non-ASCII symbols to and from
\uXXXXescapes - integration with Eclipse
Additional information
.properties files are accessed in Java applications through the java.util.Properties class. They are typically bundled as classpath resources inside JAR or WAR archives and loaded at runtime - there is no fixed default directory for them. The .ini format serves a similar role in non-Java environments, while .env files are commonly used in modern containerised deployments.
Security & safety
RISK: LOWA .properties file is plain text and cannot execute code, so opening one is safe. Two real concerns: (1) they frequently contain secrets - database passwords, API keys, connection strings - so don't paste them into untrusted online tools or commit them to public repos. (2) Editing risk: a typo, wrong encoding (saving UTF-8 where ISO-8859-1 is expected can mangle accents), or a stray character can stop the Java app from starting. Always back up the original before changing a value.
Format details
in a nutshellPrograms that open PROPERTIES files
Technical details
deep spec| Default encoding | ISO-8859-1 (Latin-1) |
| UTF-8 support | Available from Java 9+ via explicit charset argument to Properties.load() |
| Non-ASCII characters | Must be represented as \uXXXX Unicode escape sequences when using ISO-8859-1 encoding |
| Key-value separator | =, :, or unescaped whitespace - the first occurrence splits key from value |
| Comment syntax | # or ! at the start of a line |
| Line continuation | A trailing \ joins the next line into the current value; leading whitespace on the continuation line is stripped |
| Whitespace trimming | Leading whitespace before keys and between separator and value is automatically stripped |
| Duplicate key behaviour | Permitted by the parser; the last definition silently overwrites earlier ones |
| Java API class | java.util.Properties |
| MIME type | text/plain |
| Magic bytes / signature | None - plain text with no binary header; identified by file extension and key=value line structure |
| Supported escape sequences | \n, \t, \r, \\, \ (escaped space in keys/values), \uXXXX |
| Developer / maintainer | Sun Microsystems / Oracle (part of the Java platform) |
| Common deployment | Bundled as classpath resources inside JAR or WAR archives; loaded at runtime via getResourceAsStream() |
| Ecosystem adoption | Used by Java SE, Spring Framework, Android (legacy), Apache Ant, Maven, and many third-party tools |
| Released | 1996 (Java 1.0, java.util.Properties) |
| Open standard | Yes · royalty-free |
| Specification | docs.oracle.com |
PROPERTIES conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about PROPERTIES files.