Built-in speed test
Built into macOS 12 and later. Measures download and upload capacity and responsiveness against Apple's servers. -v adds latency and the interface used.
networkQualitynetworkQuality -vWi-Fi link speed
Hold ⌥ Option and click the Wi-Fi icon in the menu bar. Tx Rate is the link speed to your router, not your internet speed: a fast link to a slow connection is still slow.
Questions
How do I see my network speed on Mac?
Run networkQuality in Terminal for a speed test, or use a menu bar app like Drippy for live speeds.
Does macOS have a speed test?
Yes. networkQuality in Terminal, on macOS 12 Monterey and later.
Why is my Wi-Fi Tx Rate higher than my internet speed?
Tx Rate is the link between your Mac and the router. Your internet speed is limited by your plan and your provider.