Strconv
strconv is Go’s standard-library package for converting between strings and basic numeric, boolean, and quoted representations.
Learn Go with Pocket-Sized Projects
strconv is Go's standard-library package for converting strings to and from basic numeric and quoted representations.
- How it is used
- Supports string conversion in custom formatting code and HTTP handlers that receive numeric values as form strings.
- How deep it goes
- Demonstrates Itoa and Atoi inside working implementations, including dynamic formatting and conversion-error handling.
- Examples
- Uses currency amounts such as 10.50 and habit-frequency form fields as concrete conversion examples.
- What you can do after
- Apply it via Itoa and Atoi to construct numeric formats and parse integer-valued HTTP form inputs.
Read how Learn Go with Pocket-Sized Projects explains strconv →
Go in Action, Second Edition
strconv is a Go standard-library package for converting between strings and basic data types such as integers, floating-point numbers, and booleans.
- How it is used
- Converts textual CLI, file, environment, and configuration values into typed data and formats results for output.
- How deep it goes
- Explains parsing, validation, error handling, and formatting controls, but does not descend into conversion internals.
- Examples
- Uses port parsing with range validation, Boolean debug flags, and type-switched formatting for configuration display.
- What you can do after
- Apply strconv to parse validated configuration values and generate controlled string representations for logs, displays, and output.
Related concepts
- data conversionuses · Data conversion is the transformation of a value or data from one type, format, or representation to another, explicitly or implicitly.
- integeruses · An integer is a whole-number value with no fractional part, including negative numbers, zero, and positive numbers.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

