How can I determine an NPC's level?

Solution 1:

You can use the console command getlevel after targeting the NPC to determine his level. This obviously only works on PC, there is no way to do that on a console.

As for not getting one-hit killed, you need to use smithing to improve your armor and get some magic resistance.

Solution 2:

Here's what you're looking for.

Display Enemy Level https://www.nexusmods.com/skyrim/mods/90041