If it is a part from an official board, and using the official board definitions, just Google "arduino pinout" and the part number. There are some great diagrams for '328p. If it is a part not used on an official board, or you are using a third party board package for it (ex, a 328pb with minicore, or an attiny with one of my cores), a pinout diagram will be in the documentation included with the third party board package.
The conversion table is in the variants file. For the classic Arduino Nano, the variant used is "eightanaloginputs":https://github.com/arduino/ArduinoCore-avr/blob/master/variants/eightanaloginputs/pins_arduino.hbut that pretty much just points to the "standard" variant:https://github.com/arduino/ArduinoCore-avr/blob/master/variants/standard/pins_arduino.hThere, you will find several PROGMEM arrays. The Arduino pin number is the index of the array. So if you look at digital_pin_to_port_PGM:Code: [Select]PD,you can see that Arduino pin 4 is port Dand if you look at digital_pin_to_bit_mask_PGM:Code: [Select]_BV(4),you can see that Arduino pin 4 is bit 4 of port D (PD4)
If you looked at the pinout charts as suggested, you'd find something like this:they show the arduino pin number, the port number (eg, PC2), the analog pin number (if applicable), list any special functions, all showing which physical pin that corresponds to