USB signal routing - Swap data lines using vias?

As an addition to Armandas' answer:

If you want to use vias, there is a simple trick to swap the lines: Rotate the vias by 90 degrees, i.e. put them "above" each other. If you enter both vias from the left in the top layer and leave them to the left in the bottom layer, both lines are swapped at no expense:

Swapping two lines with vias

(Just a quick drawing as my schematics computer just told me it's absolutely necessary to install updates right now...)

At USB Full Speed you don't have to worry about length matching on the differential pair. The electric signal propagates at about 20 cm/ns in the trace.

As the signal is transmitted at 12 MBit/s each bit is 83 ns long. Assuming sampling is done in the middle of each bit period and the rise and fall times of the signals are not longer than 30 ns (which is very conservative), there is still a margin of 41 ns - 30 ns /2 = 26 ns, corresponding to a trace length of 5 meters. Given this, one can safely assume that a mismatch of several centimeters is absolutely no issue at all.


Since it's hard to describe it in the comments, I'll put it as an answer.

If space permits, you can route your signals like so:

enter image description here