Middlesex is located at 40°34'19" North, 74°29'35" West (40.572222, -74.493056).
According to the United States Census Bureau, the borough has a total area of 3.52 mi2 (9.12 km2). 3.50 mi2 (9.06 km2) of it is land and 0.02 mi2 (0.06 km2) of it is covered by water. The total area is 0.70% water.
Middlesex is located in the Eastern Standard Time (EST) timezone, GMT-05:00. It observes Daylight Saving Time (DST).