Minecraft wiki entry for Experience, associated text: Total experience =
level2 + 6 × level (at levels 0–16)
2.5 × level2 – 40.5 × level + 360 (at levels 17–31)
4.5 × level2 – 162.5 × level + 2220 (at levels 32+)
See here for a spreadsheet with Total experience and required experience up to level 10000