Bit numbering and bit order
Every bit of a value with its weight and its number under LSB 0, MSB 0 and 1-based numbering, the field you name as bits i to j, the value bit-reversed and in the order a link sends it, a printed bit string read in the order it was printed, and a MAC address in canonical and bit-reversed form, with the I/G and U/L bits named. Layouts for the LACP state, the TCP flags, the DNS flags, the ToS octet and the 802.1Q tag.
NetworkingKept in this browser · My desk
Hexadecimal needs 0x and binary 0b; plain digits are decimal, and a minus sign gives the two's complement bits.
No layout: just the bits and their numbers.
Optional: give bits i to j in the numbering above to get the field's mask, shift and value; leave the second blank for one bit.
Runs locally in your browser. Nothing is sent anywhere.
Type a value, or press Example for the DNS answer flags 0x81A0.
References
- Intel 64 and IA-32 Architectures Software Developer's Manual, volume 1, 253665-084US, June 2024: 1.3.1 Bit and Byte Order, 4.2.1.2 Signed Integers, 7.3.7 bit test and bit scan instructions
- IBM z/Architecture Principles of Operation, SA22-7832-13, fourteenth edition, May 2022: chapter 3, information formats and operand addresses
- RFC 791, Internet Protocol, September 1981 (STD 5): Appendix B, Data Transmission Order
- RFC 1035, Domain Names: Implementation and Specification, November 1987 (STD 13): sections 2.3.2 and 4.1.1
- RFC 6895, Domain Name System (DNS) IANA Considerations, April 2013 (BCP 42): section 2
- IANA, Domain Name System (DNS) Parameters, DNS Header Flags (registry updated 2026-10-16)
- RFC 3417, Transport Mappings for the Simple Network Management Protocol (SNMP), December 2002 (STD 62): section 8
- Huawei, S5700 and S6700 V200R025C00 Command Reference, Link Aggregation Commands: display eth-trunk and Table 5-17 PortState (read in a browser on 2026-11-08: the site refuses automated reads)
- Cisco, Troubleshoot EtherChannels on Catalyst 9000 Switches, document 220367, updated 8 August 2024 (read in a browser on 2026-11-08: the site refuses automated reads)
- IEEE 802.1 Working Group, IEEE8023-LAG-MIB (IEEE 802.1AX-2020), revision 2020-05-29: LacpState and dot3adAggPortActorAdminState
- The Linux kernel source, include/uapi/linux/if_bonding.h (torvalds/linux master): LACP_STATE_* masks
- RFC 9542, IANA Considerations and IETF Protocol and Documentation Usage for IEEE 802 Parameters, April 2024 (BCP 141): sections 1.1, 2.1, 2.1.1, 2.1.4 and 2.3.1
- RFC 2469, A Caution On The Canonical Ordering Of Link-Layer Addresses, December 1998 (Informational): sections 2 and 3
- IEEE Registration Authority, Guidelines for Use of Extended Unique Identifier (EUI), Organizationally Unique Identifier (OUI), and Company ID (CID), updated 1 April 2022
- The Linux kernel source, include/linux/etherdevice.h (torvalds/linux master): is_multicast_ether_addr and is_local_ether_addr
- RFC 1662, PPP in HDLC-like Framing, July 1994 (STD 51): sections 3.1, 4.5.2, 5.5 and appendix C.1
- Texas Instruments, TL16C550D Asynchronous Communications Element with Autoflow Control, SLLS597E, revised December 2008
- NXP Semiconductors, UM10204 I2C-bus specification and user manual, Rev. 7.0, 1 October 2021: 3.1.5 Byte format and Figure 10 (read in a browser on 2026-11-08: the site refuses automated reads)
- The Linux kernel source, include/linux/spi/spi.h and include/uapi/linux/spi/spi.h (torvalds/linux master): spi_device mode, SPI_LSB_FIRST
- The Linux kernel source, include/vdso/bits.h and include/linux/bits.h (torvalds/linux master): BIT and GENMASK
- The Linux kernel source, include/linux/crc32.h (torvalds/linux master): crc32_le and crc32_be
- IANA, Transmission Control Protocol (TCP) Parameters, TCP Header Flags (registry updated 2026-10-22)
- The Linux kernel source, include/net/tcp.h (torvalds/linux master): TCPHDR_* flags
- RFC 9293, Transmission Control Protocol (TCP), August 2022 (STD 7): section 3.1, header format
- RFC 2474, Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers, December 1998 (Proposed Standard, updated by RFC 3168, 3260 and 8436): section 3
- RFC 3168, The Addition of Explicit Congestion Notification (ECN) to IP, September 2001 (Proposed Standard): section 5
- The Linux kernel source, include/linux/if_vlan.h (torvalds/linux master): VLAN_PRIO_MASK, VLAN_CFI_MASK and VLAN_VID_MASK
- RFC 3986, Uniform Resource Identifier (URI): Generic Syntax, January 2005 (STD 66): section 3.5
- RFC Editor, RFC index (XML): the current status of every RFC cited