Skip to main content
Go to Latest
File
# This is a TOML document.
title = "TOML Example"
[deeply.nested.object.in.the.toml]name = "Tom Preston-Werner"dob = 2009-05-27T07:32:00
[database]server = "192.168.1.1"ports = [ 8001, 8001, 8002 ]connection_max = 5000enabled = true
[servers]
# Indentation (tabs and/or spaces) is allowed but not required [servers.alpha] ip = "10.0.0.1" dc = "eqdc10"
[servers.beta] ip = "10.0.0.2" dc = "eqdc10"
[clients]data = [ ["gamma", "delta"], [1, 2] ]
# Line breaks are OK when inside arrayshosts = [ "alpha", "omega"]
[strings]str0 = "deno"str1 = """Roses are red Violets are blue"""# On a Unix system, the above multi-line string will most likely be the same as:str2 = "Roses are red\nViolets are blue"
# On a Windows system, it will most likely be equivalent to:str3 = "Roses are red\r\nViolets are blue"str4 = "The quick brown fox jumps over the lazy dog."str5 = "this is a \"quote\""
str5 = """The quick brown \

fox jumps over \ the lazy dog."""
str6 = """\ The quick brown \ fox jumps over \ the lazy dog.\ """lines = '''The first newline istrimmed in raw strings. All other whitespace is preserved.'''
[Integer]int1 = +99int2 = 42int3 = 0int4 = -17int5 = 1_000int6 = 5_349_221int7 = 1_2_3_4_5 # VALID but discouraged
# hexadecimal with prefix `0x`hex1 = 0xDEADBEEFhex2 = 0xdeadbeefhex3 = 0xdead_beef
# octal with prefix `0o`oct1 = 0o01234567oct2 = 0o755 # useful for Unix file permissions
# binary with prefix `0b`bin1 = 0b11010110
[Date-Time]odt1 = 1979-05-27T07:32:00Zodt2 = 1979-05-27T00:32:00-07:00odt3 = 1979-05-27T00:32:00.999999-07:00odt4 = 1979-05-27 07:32:00Zld1 = 1979-05-27lt1 = 07:32:00 #buggylt2 = 00:32:00.999999 #buggy
[boolean]bool1 = truebool2 = false
[float]# fractionalflt1 = +1.0flt2 = 3.1415flt3 = -0.01
# exponentflt4 = 5e+22flt5 = 1e6flt6 = -2E-2
# bothflt7 = 6.626e-34flt8 = 224_617.445_991_228# infinitysf1 = inf # positive infinitysf2 = +inf # positive infinitysf3 = -inf # negative infinity
# not a numbersf4 = nan # actual sNaN/qNaN encoding is implementation specificsf5 = +nan # same as `nan`sf6 = -nan # valid, actual encoding is implementation specific
[Table]name = { first = "Tom", last = "Preston-Werner" }point = { x = 1, y = 2 }animal = { type.name = "pug" }
[[fruit]] name = "apple"
[fruit.physical] color = "red" shape = "round"
[[fruit.variety]] name = "red delicious"
[[fruit.variety]] name = "granny smith"
[[fruit]] name = "banana"
[[fruit.variety]] name = "plantain"