Projects / Ascii2Binary


The Ascii2Binary project consists of two complementary programs that convert between textual and binary representations of numbers. Ascii2Binary reads input consisting of textual representations of numbers separated by whitespace and produces as output the binary equivalents. It is useful for generating test data and linking programs that generate textual output to programs that require binary input. Binary2Ascii converts binary numbers to text. In both programs, the type and size/precision of the input or output is selected using command line flags.

Operating Systems

Recent releases

  •  30 Aug 2010 05:24

    Release Notes: endian.h was renamed to avoid conflict with the external endian.h. Minor changes were made in the man pages.

    •  13 Feb 2007 09:00

      Release Notes: The information provided by the -s flag about the machine has been reformatted and now includes the extreme values for each type. Information about wchar_t has been added.

      •  19 Dec 2006 11:21

        Release Notes: The -s flag, which reports the numeric types available and their sizes, is now auto-configured so that types such as long double that are not available on all systems will be reported if they are.

        •  19 Apr 2006 21:38

          Release Notes: ascii2binary can now handle numbers with thousands separators. A new command line flag has been added that sets the locale for the LC_NUMERIC facet. In the case of ascii2binary, this determines what character will be interpreted as the thousands separator. In the case of binary2ascii, this controls thousands separation and decimal point. Among other things, this means that a pipeline of ascii2binary followed by binary2ascii can be used to convert numeric strings from one locale's format to that of another. Flags have been added for suppressing thousands separation and zero-padding.

          •  12 Mar 2006 06:48

            Release Notes: The -l option was added to add a linefeed after every 0x0A where the size is char, byte, short, or int; that is, the sizes where 0x0A might represent a character. Long options are now provided if getopt_long is available.

            Recent comments

            18 Jan 2014 15:23 fgnievinski

            please note: although it'll compile in mingw for windows, results are unreliable, e.g.:

            $ echo "1" | ascii2binary | binary2ascii

            (expected output: 1)

            18 Jan 2014 13:39 fgnievinski

            here's a patch for ascii2binary.c:

            > #ifdef HAVE_LANGINFO_H
            > #endif


            Project Spotlight


            A Fluent OpenStack client API for Java.


            Project Spotlight

            TurnKey TWiki Appliance

            A TWiki appliance that is easy to use and lightweight.