[Go] Convert a uint32 to a string

Created on November 28, 2026

You can use strconv.FormatUint() to convert a uint32 value to a string. The first argument to FormatUint() must be a uint64, so convert the uint32 value to uint64 before passing it in. The second argument sets the numeric base. This example uses base 10.

package main

import (
    "fmt"
    "strconv"
)

func main() {
    var n uint32 = 111
    nStr := strconv.FormatUint(uint64(n), 10)
    fmt.Printf("%s", nStr)
}

The program produces the following output.

111
Go