MSS Calculator
Calculate TCP maximum segment size from MTU and header overhead.
About MSS Calculator
The Maximum Segment Size is the largest chunk of TCP payload data that fits into a single frame without fragmentation, calculated by subtracting the IP header (20 bytes for IPv4, 40 for IPv6) and the TCP header (20 bytes, more with options) from the link's MTU. Getting MSS right matters because if it is set too high for the actual path, routers must either fragment IPv4 packets (inefficient) or, if the Don't Fragment bit is set, drop them and rely on Path MTU Discovery — which can silently fail behind misconfigured firewalls that block the required ICMP messages, a classic cause of connections that hang on large transfers but work fine for small ones.
Formula
MSS from MTU
MSS = MTU − IP_header(20 or 40) − TCP_header(20) − TCP_options
- H_IP
- IP header size (20 IPv4 / 40 IPv6)
- H_TCP
- TCP header size (20 bytes base)
- O_TCP
- Optional TCP options bytes
Worked example
With the default values below, MSS Calculator returns Maximum Segment Size (MSS) of 1,460. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Interface MTUaccepts 68–9,216 bytes
- 1,500 bytes
- IP Versionone of IPv4 (20-byte header), IPv6 (40-byte header)
- IPv4 (20-byte header)
- TCP Optionsaccepts 0–40 bytes
- 0 bytes
Results
- Maximum Segment Size (MSS)
- 1,460 bytes
- Total Header Overhead
- 40 bytes
- IP Header Size
- 20 bytes
- MSS over PPPoE (−8 bytes)
- 1,452 bytes
Step by step
- 1Values used
- 2MSS from MTU
- 3Maximum Segment Size (MSS)= 1,460 bytes
- 4Total Header Overhead= 40 bytes
- 5IP Header Size= 20 bytes
- 6MSS over PPPoE (−8 bytes)= 1,452 bytes
Assumptions and limits
- The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
What is the default MSS for a standard 1500-byte Ethernet MTU?
For IPv4 with no TCP options: 1500 − 20 (IP) − 20 (TCP) = 1460 bytes. For IPv6, the larger 40-byte IP header reduces it to 1500 − 40 − 20 = 1440 bytes.
Why does MSS matter for VPN and tunnel connections?
Tunneling protocols (PPPoE, GRE, IPsec) add their own encapsulation headers on top of the standard IP/TCP headers, effectively reducing the usable MTU. If the MSS isn't lowered to match, oversized packets get fragmented or dropped, which is a common cause of connections that work for small requests but hang or fail on larger transfers like HTTPS pages with big responses.
How is MSS negotiated between two hosts?
Each side of a TCP connection advertises its own MSS in the SYN packet during the three-way handshake, based on its own outgoing interface's MTU. Both sides then use the smaller of the two advertised values for the connection, though this does not account for smaller MTUs on intermediate hops unless Path MTU Discovery is also functioning correctly.
