How to get the NPC ID

I know that you can mess with NPCs when you know their ID. For example typing in the console:

prid 3f2bb 
moveto player

Selects Strong as target (where ever he may be) and then moves him to the player.

But how can I find out the ID of any random NPC that I encounter in the game? Is there a way to click on them and maybe type "get base_id" or so?


If you enable the console with an NPC in view you can just click on them and it will "select" them and display their id in the upper center of the console.

For example, I just did this with MacCready, and in the upper centre of the console it reads: "(0002a8a7) [EP]

MacCready's ref id is 0002a8a7.


There's a full list of the character IDs (not just companions) here.

You'll have to search the page for the companion's name.

There are actually IDs for just about everything on the other sections of the site if you search for "fallout 4 console commands".