What is a TOML?
TOML is abbreviated as Tom’s Obvious, Data format serialization language and it is a new file format.
It is used for specifying data in configurations similar to YAML.
Usually, each software or application has some configuration data, Before the TOML format exists, We used to have a property file with key and value pairs like key=value.
The property files are not suitable when there is a complex structure of configuration.
TOML is suitable for representing data in hashtable format and is easy to read and write data using various programming languages.
Advantages of TOML
- It is human-readable for complex configuration and settings
- Supports Comments
- Gain more popularity than other file formats
- Read and write capabilities
- the content of these files looks like windows init format
Disadvantages of TOML
- Numbers like NAN and infinity are not supported
- No support for binary data
- Only supports a few data types, not extendable
TOML use cases
- TOML can be used in many types of projects for different purposes
- Configuration and settings of the software applications
TOML file extension
TOML document grouped in a file with extension
toml, You can use any IDE or text editor to open this file.
All the popular IDE supports the
toml file extension and also provides plugins to validate the
toml file content
toml data rules
- data in toml files are case sensitive
- file supports UTF-8 encoding format only
- Supports whitespaces, tabs, and newlines asci code
MIME format type - application/toml
MIME is abbreviated as
Multipurpose Internet Mail Extensions.
It is a format specified in request and response that is transferred between client and server across the internet.
accept headers in a request object are specified with this format.
Following is the mime type for these documents
and request contains the below value for
toml data sending over the internet
Let’s see some frequently asked questions on
How do I view TOML files?
Toml files are like text files that can be opened in any normal text editor like notepad or notepad++.
Basic editors do not provide validation and format of
You can use Sublime text, Intelli IDEA, and Visual studio editors that have rich plugins to format and validate
Normal editors in Windows, Apple, and Unix flavors support reading toml files.
What is TOML used for?
Toml file is like a normal ini file in windows that can be used to support configuration settings in different applications using multiple programming languages.
Spring projects, toml file used to configure environment settings for different environment profiles.
It provides strong typing to make it a configuration with typed values.
Does toml supports comments
comments are useful text to describe the line of code. toml support comments using the following syntax. Toml files are easily readable by humans. Comments make clean and readability in maintaining configuration in applications.
# profile for development environment [development] server = "dev.localhost"