You can do it with a router with a fence. Or with a circular saw with a fence. Or with an electric plane with a fence. The latter I would say was best. Saves having to buy special bits which only cut a particular size.
It's easiest to form this sort of thing on the edge of a much wider bit of wood and then cut it off afterwards. Stops the wood from deflecting under load whilst being machined.