A 31-year-old man and a 45-year-old man have died in separate car crashes north of Brisbane.

Two men have been killed after crashing their cars into trees in separate incidents north of Brisbane.

In the first incident, a 45-year-old man died after veering off a road and into a tree in Gundiah about 4pm on Wednesday (AEST).

Emergency services were called to the second crash at Elimbah, north of Caboolture, three hours later.

Police said investigations suggested the driver had come off the road on a left bend and gone into the tree.