NUMFMT(1)
โจ NUMFMT ๐ the number glow-up machine โจ
okay bestie, so this is numfmt, and she lives in the User Commands part of the manual (section 1). If you've ever stared at 1048576 and thought "girl, what is that in vibes" โ this is the page for you. ๐ซถ
๐ NAME ๐
numfmt โ Convert numbers from/to human-readable strings
๐ฆ SYNOPSIS ๐ฆ
numfmt [OPTION]... [NUMBER]...
๐ธ DESCRIPTION ๐ธ
Reformat NUMBER(s) โ or, if you didn't hand her any numbers, the numbers coming in from standard input. She'll take them and give them the glow-up. โจ
Mandatory arguments to long options are mandatory for short options too. (yes bestie, that rule is universal, no exceptions, periodt.)
--debugโ print warnings about invalid input ๐-d,--delimiter=Xโ useXinstead of whitespace for the field delimiter--field=FIELDSโ replace the numbers in these input fields (default=1); scroll down to FIELDS for the deets--format=FORMATโ use printf style floating-pointFORMAT; see FORMAT below for the deets--from=UNITโ auto-scale input numbers toUNITs; default is'none'; see UNIT below for the deets--from-unit=Nโ specify the input unit size (instead of the default1)--groupingโ use locale-defined grouping of digits, e.g.1,000,000. lowkey important: this has no effect in the C/POSIX locale ๐ฅฒ--header[=N]โ print (without converting) the firstNheader lines;Ndefaults to1if you don't specify it--invalid=MODEโ failure mode for invalid numbers;MODEcan be:abort(default),fail,warn,ignore--padding=Nโ pad the output toNcharacters; positiveNwill right-align, negativeNwill left-align; padding is ignored if the output is wider thanN; the default is to automatically pad if a whitespace is found--round=METHODโ useMETHODfor rounding when scaling;METHODcan be:up,down,from-zero(default),towards-zero,nearest--suffix=SUFFIXโ addSUFFIXto output numbers, and accept an optionalSUFFIXin input numbers--unit-separator=SEPโ insertSEPbetween number and unit on output, and accept an optionalSEPin input numbers--to=UNITโ auto-scale output numbers toUNITs; see UNIT below--to-unit=Nโ the output unit size (instead of the default1)-z,--zero-terminatedโ line delimiter is NUL, not newline--helpโ display this help and exit--versionโ output version information and exit
๐ UNIT options ๐
noneโ no auto-scaling is done; suffixes will trigger an error ๐จautoโ accept optional single/two letter suffix:1K = 1000,1k = 1000,1Ki = 1024,1M = 1000000,1Mi = 1048576,siโ accept optional single letter suffix:1k = 1000,1K = 1000,1M = 1000000, ...iecโ accept optional single letter suffix:1K = 1024,1k = 1024,1M = 1048576, ...iec-iโ accept optional two-letter suffix:1Ki = 1024,1ki = 1024,1Mi = 1048576, ...
๐ง FIELDS ๐ง
okay so FIELDS supports cut(1) style field ranges, and honestly? iconic behaviour:
Nโ N'th field, counted from 1N-โ from N'th field, to end of lineN-Mโ from N'th to M'th field (inclusive)-Mโ from first to M'th field (inclusive)-โ all fields- Multiple fields/ranges can be separated with commas
๐ FORMAT ๐
FORMAT must be suitable for printing one floating-point argument '%f'.
Optional quote (%'f) will enable --grouping (if supported by current locale). Optional width value (%10f) will pad output. Optional zero (%010f) width will zero pad the number. Optional negative values (%-10f) will left align. Optional precision (%.1f) will override the input determined precision.
๐ exit status, bestie ๐
Exit status is 0 if all input numbers were successfully converted.
By default, numfmt will stop at the first conversion error with exit status 2.
- With
--invalid='fail'a warning is printed for each conversion error and the exit status is2. - With
--invalid='warn'each conversion error is diagnosed, but the exit status is0. - With
--invalid='ignore'conversion errors are not diagnosed and the exit status is0.
not her being forgiving inwarnandignoremode ๐ญ she really said "no stress, we move on."
๐ EXAMPLES ๐
$ numfmt --to=si 1000
-> "1.0k"
$ numfmt --to=iec 2048
-> "2.0K"
$ numfmt --to=iec-i 4096
-> "4.0Ki"
$ echo 1K | numfmt --from=si
-> "1000"
$ echo 1K | numfmt --from=iec
-> "1024"
$ df -B1 | numfmt --header --field 2-4 --to=si
$ ls -l | numfmt --header --field 5 --to=iec
$ ls -lh | numfmt --header --field 5 --from=iec --padding=10
$ ls -lh | numfmt --header --field 5 --from=iec --format %10f
๐ AUTHOR ๐
Written by Assaf Gordon. (shoutout ๐ซก)
๐จ REPORTING BUGS ๐จ
Report bugs to: <bug-coreutils@gnu.org>. Report any translation bugs to: <https://translationproject.org/team/>. GNU coreutils home page: <https://www.gnu.org/software/coreutils/> General help using GNU software: <https://www.gnu.org/gethelp/>
๐ COPYRIGHT ๐
Copyright ยฉ 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
that "NO WARRANTY" is in all caps for a reason bestie, do not come for her if something breaks ๐
๐ SEE ALSO ๐
Full documentation <https://www.gnu.org/software/coreutils/numfmt> or available locally via: info '(coreutils) numfmt invocation'
and that's the whole page, no cap. this was GNU coreutils 9.12, from September 2026 โ she's serving section 1 of the User Commands manual and she ate ๐ โจ
๐ฆ where this page comes from
- arch rolling: coreutils 9.12-2 ยท GPL-3.0-or-later AND GFDL-1.3-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms