# Automatically numbering elements in Kicad

Does Kicad have a function to automatically number components?

At the moment, whenever I insert a new resistor, I must also number it (e.g. R? -> R12). Is there a way to do that automatically?

Yes, you can have KiCAD generate the reference numbers automatically.

Following the directions from this site, you can leave the references undefined (with the question mark.)

You then generate a netlist.
If there are any unassigned references, the netlist generator will ask if you want to annotate them.
Let it do that, and it will number all your parts for you automatically.

Warning:
When you let KiCAD number the references, it will also ask if it should renumber all of the existing parts. If you've already placed parts on the layout, and allow the netlist generator to renumber everything, then you will have a mess in your layout.

I've done it, and the simplest way out was to just remove everything from the layout and do it all over again.

• have you ever used the Timestamp option when reading a newly generated netlist into PCBNew which has removed and re-numbered components? The warning you provide in your answer makes me think that maybe the option wasn't available in PCBNew when you originally posted. I outlined how the Timestamp option works in my answer. – ubiquibacon Dec 29 '18 at 7:21
• @ubiquibacon: I don't recall seeing the "Timestamp" option when I wrote this answer. I also don't remember what version of KiCAD I was using. I have version 4.04 now, and saw the "Timestamp" option last night while making a new board. – JRE Dec 29 '18 at 8:55

I am using KiCAD 5.0.0 and as I refine my board design I often open Eeschema's Tools -> Annotate Schematic dialog and select the Reset existing annotations option. After doing this I load the newly generated netlist into PCBNew, making sure to select the Timestamp radio button in the PCBNew Netlist dialog. The Timestamp option tells PCBNew to select footprints based on their timestamp opposed to using the reference number which is the "normal way". This allows PCBNew to know that what was R17 is now R12, what was C4 is now C2, etc.