BGP AS-Path Visualizer
Paste an AS path. See how long BGP considers it, where prepending has been used, and whether anything in it is private, repeated or invalid.
Local toolYour network plan stays in your browser. Nothing you enter is uploaded, logged, or sent to any server.
repeated (prepend) private invalid
How the path is read
The AS path records which autonomous systems a route has crossed, most recent first. The rightmost ASN is where the route originated.
Length is what BGP compares, and it is not simply the number of ASNs written. A sequence contributes one per ASN. An AS_SET, written in braces, counts as one however many it contains — it records an unordered set produced by aggregation rather than a series of hops. Counting its members instead changes which route wins, which is why the distinction is worth knowing.
Prepending is an operator repeating their own ASN to make a path look longer, so other networks prefer a different route. It is the standard way to make one link less attractive without withdrawing it. Repetition is therefore normal and not a fault.
A genuine loop is an ASN appearing more than once with something else in between. BGP drops a route whose path already contains its own AS, which is the loop prevention mechanism; a path showing one in the middle usually means aggregation or a configuration doing something unusual.
Private ASNs — 64512–65534 and 4200000000–4294967294 — should not appear in paths on the public internet. Seeing one usually means a provider forgot to strip it.
Loop prevention comes first
Path length is what people notice, but it is not what the AS path is primarily for. Its first job is to stop routes circling forever: a BGP speaker that receives a path already containing its own AS number discards it, on the grounds that the route has been here before. That single rule is what makes inter-domain routing terminate at all, and it is enforced before any question of which path is better.
It has a practical consequence that surprises people running the same AS number in two places. If two sites share an ASN and are connected only through a third party, each will reject the other's routes as a loop — correctly, by the rule as written, and inconveniently, given they are the same organisation. The usual answers are to allow the ASN in explicitly on the receiving side or to stop reusing the number, and both are decisions to make deliberately rather than discover.
What prepending can and cannot do
Adding your own ASN to a path several times makes it look longer, and a longer path loses a comparison against a shorter one. It is the standard way to make one of your links less attractive without withdrawing anything.
Its reach is narrower than it looks. Path length is a long way down BGP's decision process: local preference is compared first, and a network that has set local preference on its own links will never reach the length comparison at all. Prepending therefore influences the networks that see both of your paths and have no stronger opinion — which may be far fewer than you hoped, and is why traffic often refuses to move.
The other limit is that it saturates. Once your path is comfortably longer than the alternative, more copies achieve nothing, and very long prepends are treated as noise or filtered outright by some networks. Three is usually plenty; a dozen mostly signals that prepending was the wrong instrument and the conversation needed to be with the other network instead.
Related tools
Best-Path Simulator uses this length to choose a route. Community Builder parses the other common attribute.