# Format String Reference?

**URL:** <https://ziggit.dev/t/format-string-reference/17304>\
**Category:** Brainstorming\
**Tags:** zig-docs, standard-library\
**Created:** [August 20, 2026, 4:19pm UTC](https://ziggit.dev/t/format-string-reference/17304 "2026-08-20T16:19:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![candela](https://ziggit.dev/user_avatar/ziggit.dev/candela/32/2272_2.png) [@candela](https://ziggit.dev/u/candela)\
**Post date:** [August 20, 2026, 4:19pm UTC](https://ziggit.dev/t/format-string-reference/17304/1 "2026-08-20T16:19:15Z")

</div>

EDIT: Format strings are quite well-documented [here](https://ziglang.org/documentation/master/std/#std.Io.Writer.print)

What would be the best place to put a formatting specifier / formatting string reference? Right now I’m not aware of a good cheatsheet, which sometimes leads to me just trying something to see if it works (e.g., I only learned yesterday that `{x}` works on slices, not just numbers).

[zig.guide](https://zig.guide/standard-library/formatting-specifiers/) has an ok-ish list, but it doesn’t mention optionals, `{any}`, `{t}`, or bare `{}`, doesn’t mention that `{x}` can have precision specifiers, and IMO should be a table for easy reference. Also, it doesn’t seem to have anything past 0.15.2.

Reading the `std/fmt.zig` source helps, but it’s not exactly terse and it would be nice to have something in the documentation or here on ziggit. Would this be a reasonable PR? Or maybe a “docs” topic here?

Or maybe this just isn’t a problem other people have?

---

<div class="post-metadata">

**Author:** ![jonrm](https://ziggit.dev/user_avatar/ziggit.dev/jonrm/32/9572_2.png) [@jonrm](https://ziggit.dev/u/jonrm)\
**Post date:** [August 20, 2026, 4:27pm UTC](https://ziggit.dev/t/format-string-reference/17304/2 "2026-08-20T16:27:03Z")

</div>

The docs I use for this are here: [Zig Documentation](https://ziglang.org/documentation/master/std/#std.Io.Writer.print)

Although I will admit, just yesterday I forgot where this page was, going through std.fmt and std.debug.print before finally remembering it was in Writer.print. Re-found it before long, but it wasn’t in the first place I looked.

---

<div class="post-metadata">

**Author:** ![candela](https://ziggit.dev/user_avatar/ziggit.dev/candela/32/2272_2.png) [@candela](https://ziggit.dev/u/candela)\
**Post date:** [August 20, 2026, 4:29pm UTC](https://ziggit.dev/t/format-string-reference/17304/3 "2026-08-20T16:29:37Z")

</div>

oh my god, that’s embarrassing, thanks

---

<div class="post-metadata">

**Author:** ![jonrm](https://ziggit.dev/user_avatar/ziggit.dev/jonrm/32/9572_2.png) [@jonrm](https://ziggit.dev/u/jonrm)\
**Post date:** [August 20, 2026, 4:32pm UTC](https://ziggit.dev/t/format-string-reference/17304/4 "2026-08-20T16:32:46Z")

</div>

Sure thing! And no need to be embarrassed haha, I also find that page easy to miss

---

<div class="post-metadata">

**Author:** ![jeffective](https://ziggit.dev/user_avatar/ziggit.dev/jeffective/32/3116_2.png) [@jeffective](https://ziggit.dev/u/jeffective)\
**Post date:** [August 20, 2026, 7:36pm UTC](https://ziggit.dev/t/format-string-reference/17304/5 "2026-08-20T19:36:06Z")

</div>

It is a zig rite of passage to try and find the fmt string docs

---

<div class="post-metadata">

**Author:** ![Anthon](https://ziggit.dev/user_avatar/ziggit.dev/anthon/32/8967_2.png) [@Anthon](https://ziggit.dev/u/Anthon)\
**Post date:** [August 21, 2026, 7:23am UTC](https://ziggit.dev/t/format-string-reference/17304/6 "2026-08-21T07:23:36Z")

</div>

The master doc for `print` doesn’t seem to include the handy `{q}` yet.

---

<div class="post-metadata">

**Author:** ![Lygaen](https://ziggit.dev/user_avatar/ziggit.dev/lygaen/32/7197_2.png) [@Lygaen](https://ziggit.dev/u/Lygaen)\
**Post date:** [August 21, 2026, 7:28am UTC](https://ziggit.dev/t/format-string-reference/17304/7 "2026-08-21T07:28:57Z")

</div>

Just as this discussion popped up, andrew made a PR changing a bit the format API (Adding a `qf`) [https://codeberg.org/ziglang/zig/pulls/36596](https://codeberg.org/ziglang/zig/pulls/36596)

---

<div class="post-metadata">

**Author:** ![ieh3oh](https://ziggit.dev/letter_avatar_proxy/v4/letter/i/c5a1d2/32.png) [@ieh3oh](https://ziggit.dev/u/ieh3oh)\
**Post date:** [August 21, 2026, 6:43pm UTC](https://ziggit.dev/t/format-string-reference/17304/8 "2026-08-21T18:43:19Z")

</div>

I had this exact question recently. It took me a while to find [std.Io.Writer.print](https://ziglang.org/documentation/master/std/#std.Io.Writer.print) because usually I’m looking at [std.mem.Allocator.print](https://ziglang.org/documentation/master/std/#std.mem.Allocator.print) or some other `print` method docs.

Makes sense for it to be in `std.Io.Writer.print` though.

---

<div class="post-metadata">

**Author:** ![pachde](https://ziggit.dev/user_avatar/ziggit.dev/pachde/32/2485_2.png) [@pachde](https://ziggit.dev/u/pachde)\
**Post date:** [August 21, 2026, 6:50pm UTC](https://ziggit.dev/t/format-string-reference/17304/9 "2026-08-21T18:50:14Z")

</div>

I hope some day the docs will get good cross references.

---

<div class="post-metadata">

**Author:** ![jesseb34r](https://ziggit.dev/user_avatar/ziggit.dev/jesseb34r/32/9968_2.png) [@jesseb34r](https://ziggit.dev/u/jesseb34r)\
**Post date:** [August 21, 2026, 9:41pm UTC](https://ziggit.dev/t/format-string-reference/17304/10 "2026-08-21T21:41:46Z")

</div>

Definitely the std library docs will get a lot more love when things become more stable. Hard to focus on writing great docs when the underlying code changes so much, and also the code is quite readable. I often discover the docs for the thing I’m trying to do just by doing `go to definition` or grepping the std library source for the functions I’m using to see how the args should be composed.
