# go-toml

> Read and write TOML 1.1 in Go, with an encoding/json-style API

Source: https://talira.ai/catalog/go-toml-zzk1bxz2
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library, Command-line tool
- Categories: [developer tools / parsing / toml](https://talira.ai/categories/developer-tools/parsing/toml), [languages / go](https://talira.ai/categories/languages/go)
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Pricing notes: Free and open source (MIT).
- Free tier: yes[^1]
- Supports: [TOML](https://talira.ai/standards/toml.md)[^1]
- Backed by: [Thomas Pelletier](https://talira.ai/orgs/thomas-pelletier.md)

go-toml is a Go library for reading and writing TOML, supporting TOML v1.1.0. It works like the standard library's encoding/json, with a strict mode that errors on keys the target struct doesn't have, decoding errors that show the offending line in context, local date and time types, and output with comments for generated config files. It also ships three command-line tools: tomljson (TOML to JSON), jsontoml (JSON to TOML) and tomll (lint and reformat TOML), also as a Docker image.

## Links

- GitHub: https://github.com/pelletier/go-toml
- Docs: https://pkg.go.dev/github.com/pelletier/go-toml/v2

## Problems it solves

- parse a TOML config file into Go structs
- catch typos in a TOML config by failing on unknown keys in Go
- convert a TOML file to JSON on the command line

## Features

- TOML v1.1.0 support
- Marshal and Unmarshal like encoding/json
- strict mode that rejects unknown keys
- contextualized decode errors that show the offending line
- LocalDate, LocalTime and LocalDateTime types
- commented output for generated config files
- tomljson, jsontoml and tomll command-line tools and Docker image

## Trust

Overall: 0.39 out of 1.
Signals: maintenance 0.27, adoption 0.66, momentum 0.34, community 0.81, backing 0.30, extensibility 0.00.

- latest release v2.4.3 4 months ago
- 2.0k GitHub stars
- 104 contributors
- backed by Thomas Pelletier

Warnings:

- last commit 4 months ago

## Alternatives

- [toml (BurntSushi)](https://talira.ai/catalog/toml-burntsushi-0w973zf2.md): Decode and encode TOML in Go, like encoding/json

## Sources

[^1]: https://github.com/pelletier/go-toml/blob/v2/README.md (checked 29 Nov 2026)
[^2]: https://github.com/pelletier/go-toml/blob/v2/LICENSE (checked 29 Nov 2026)
