---
source: https://iinventedlight.com/library/notes/go-tabwriter.md
title: "text/tabwriter: align tabbed columns in Go"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (Go); BSD-3-Clause (Go); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Go, text/tabwriter package reference; Go, text/tabwriter/tabwriter.go source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-23
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-23
as_of: 2026-11-23
confidence: medium
untested: "Not reproduced (2026-11-23). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: go-tabwriter"
tags: [go, tabwriter, text, formatting, columns]
client: Librarian
sources:
  - id: S1
    title: "text/tabwriter package reference"
    publisher: Go
    url: https://pkg.go.dev/text/tabwriter
    accessed: 2026-11-23
    license: "BSD-3-Clause"
  - id: S2
    title: "text/tabwriter/tabwriter.go source"
    publisher: Go
    url: https://go.dev/src/text/tabwriter/tabwriter.go
    accessed: 2026-11-23
    license: "BSD-3-Clause"
---
# text/tabwriter: align tabbed columns in Go
**Answer:** Package tabwriter implements a write filter that translates tabbed columns in input into properly aligned text. It uses the Elastic Tabstops algorithm. The package is frozen and is not accepting new features.

## What the filter does

Package tabwriter implements a write filter (tabwriter.Writer).

The filter translates tabbed columns in input into properly aligned text.

The package is frozen, so it is not accepting new features.

Alignment uses the Elastic Tabstops algorithm.

## Creating a writer

NewWriter allocates and initializes a new Writer.

Flush should be called after the last call to Write.

A cell is a segment of text ended by a tab or a line break.

## See also

- [go-fmt](https://iinventedlight.com/library/notes/go-fmt/)
- [go-strings](https://iinventedlight.com/library/notes/go-strings/)

## Claims

- id: C1
  claim: tabwriter translates tabbed columns into aligned text.
  source: S1
  evidence: "translates tabbed columns in input into properly aligned text"

- id: C2
  claim: The package uses the Elastic Tabstops algorithm.
  source: S1
  evidence: "using the Elastic Tabstops algorithm"

- id: C3
  claim: The package is frozen and is not accepting new features.
  source: S1
  evidence: "frozen and is not accepting new features"

- id: C4
  claim: A cell is text terminated by tabs or line breaks.
  source: S2
  evidence: "terminated by tabs or line breaks"

## Sources

- [S1] text/tabwriter package reference. Go. https://pkg.go.dev/text/tabwriter . License: BSD-3-Clause. Accessed 2026-11-23.

- [S2] text/tabwriter/tabwriter.go source. Go. https://go.dev/src/text/tabwriter/tabwriter.go . License: BSD-3-Clause. Accessed 2026-11-23.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Go, text/tabwriter package reference; Go, text/tabwriter/tabwriter.go source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
