DSCP and ToS Converter – Translate QoS Values Instantly
Network QoS (Quality of Service) configuration requires working with several overlapping representations of the same priority information: DSCP decimal values, ToS byte decimals, ToS hex codes, IP Precedence levels, and PHB class names such as EF, AF41, and CS3. This converter lets you enter any one format and immediately see all the others — eliminating the manual arithmetic that leads to misconfigured policy maps and ACLs.
Understanding the DS Byte
The IPv4 ToS (Type of Service) byte was redefined by RFC 2474 (1998) as the DS byte. Its 8 bits are split into two independent fields:
- DSCP (bits 7–2): a 6-bit Differentiated Services Code Point that encodes QoS priority. Values range from
0(best effort) to63. - ECN (bits 1–0): a 2-bit Explicit Congestion Notification field added by RFC 3168. Standard traffic sets these bits to
00; ECN-capable endpoints negotiate01or10.
The ToS byte therefore equals DSCP × 4 for standard (non-ECN) traffic. For example, EF has DSCP 46: 46 × 4 = 184 decimal = 0xB8 hex = 10111000 binary.
DSCP to ToS Hex Conversion Formula
The conversion is a simple left-shift: ToS = DSCP << 2. In decimal arithmetic: ToS = DSCP × 4. To go the other direction: DSCP = ToS >> 2 (integer division by 4, ignoring the lower 2 ECN bits). Applying these formulas manually for every class in a QoS policy is error-prone — this tool automates the entire translation in both directions.
IP Precedence Backward Compatibility
The original RFC 791 ToS byte included a 3-bit IP Precedence subfield occupying bits 7–5. Network equipment predating DiffServ still honors these 8 priority levels (Routine through Network Control). DSCP preserves backward compatibility through the Class Selector (CS) PHBs: CS0–CS7 equal DSCP values 0, 8, 16, 24, 32, 40, 48, and 56 respectively — each a multiple of 8, keeping the upper 3 bits identical to the old IP Precedence value.
PHB Classes and Traffic Mapping
RFC 4594 defines a standard enterprise QoS model with four PHB categories:
- Default (DSCP 0): best-effort forwarding with no guarantees — suitable for background web browsing and bulk file transfers.
- Assured Forwarding (AF11–AF43): twelve codepoints across four classes and three drop precedences. Used for differentiated data traffic with probabilistic loss protection under congestion.
- Expedited Forwarding (EF, DSCP 46): strict priority with guaranteed bandwidth, minimal latency, and low jitter. The standard choice for VoIP bearer (RTP) streams.
- Class Selectors (CS1–CS7): compatible with IP Precedence for legacy equipment. CS6 and CS7 are typically reserved for network control plane traffic (OSPF, BGP, EIGRP).
Practical Use: QoS Policy Maps
When configuring a router or switch, you may encounter QoS policy maps that use DSCP decimal values, others that use hex ToS bytes (especially in firewall ACLs), and legacy equipment that only understands IP Precedence levels. Common examples:
- Cisco IOS
set dscp efmarks VoIP RTP with DSCP46— ToS byte0xB8. - Linux
tc/iptablesrules often specify the ToS hex byte directly:--tos 0x68for AF31 (DSCP26, streaming video). - Wireshark DSCP filters use decimal:
ip.dsfield.dscp == 46. - Juniper JunOS uses DSCP names directly:
forwarding-class assured-forwarding loss-priority low.
How to Use This Converter
Select your input format — DSCP decimal, ToS decimal, ToS hex, or IP Precedence — and type your value. The converter instantly displays all equivalent representations alongside the matching PHB class, traffic class, and drop precedence. The DS byte structure diagram shows the bit-level layout so you can visually verify the split between the DSCP field (bits 7–2) and the ECN field (bits 1–0). A quick-reference table of the most common DSCP assignments is always visible for fast lookups without needing to enter a value.