Switches:
- Works out of the box straight away
- Supports broadcast
- Works on DL layer
- Creates a network
- Has more ports (typically, 24, 36, 48 ports etc).
- Works on MAC addresses (HW address)
- Maintains CAM table (Content Addressable Memory)
Routers:
- Does not work out of the box (needs configuration)
- Does not support broadcast
- Works on Network Layer
- Connects the networks
- Has limited set of ports (typically, 2, 4, 6, 8)
- Works on IP addresses (software address)
- Maintains Routing table