Router and Switch are both networks connecting devices. Router works at network layer and is responsible to find the shortest path for a packet whereas Switch connects various devices in a network. Router connects devices across multiple networks. Following are the important differences between Router and Switch.
While a network switch can connect multiple devices and networks to expand the LAN, a router will allow you to share a single IP address among multiple network devices. In simpler terms, the Ethernet switch creates networks, and the router allows for connections between networks.