A hinge mechanism includes two pivoting shafts substantially parallel to each other, two main gears non-rotatably sleeved on the pivoting shafts, respectively. The hinge mechanism further includes two transmission gears positioned between the main gears, and two brackets sleeved on the pivoting shafts, respectively. Each transmission gear meshes with the other transmission gear and one main gear. Each pivoting shaft includes a flange which defines two locking portions, and each bracket forms two latching portions engaging with the locking portions of each pivoting shaft. The locking portions and the latching portions are selected from the structures of groove and hook.