Creating a new footprint library


Where should i place my new library?

Further reading: Library management in KiCad version 5
This depends on your personal preference. KiCad does not care where you place your libs as long as your operating system allows you to write to the selected location.
If the library will be used to store project specific footprints then it makes sense to place the library file somewhere under the project directory.
All other libs are best collected into a single directory that is somewhere in your users home directory. (This allows easy backup and sharing of your libraries.)

What should i name my library?

The library name should be unique within the chosen library table. It should also communicate what footpirnts to expect within it to your target audience. Do not include special chars inside your library name as it might create problems in some platforms.
This means the most shareable name will only contain letters, numbers, underline and minus. (This is only a suggestion. Add additional chars at your own risk.)

Selecting the library table

After creating the library you will need to add the library to the global or project library table. Adding it to the global table will make this lib visible to all your projects. The project (also known as local) library table only adds it to the current project.


Making a new Footprint Library in KiCad version 5.1.x

Footprint libraries are created from within the footprint editor. To create a new library you have two options. Either use the New Library entry of the File menu or of the context menu in the tree view.

After pressing this button you will be presented with a file browser. The exact look of this depends on your operating system. Using this dialog you can select where you want your library to be stored. In addition there will be some form of text field that allows you to enter the name of the library.

By default the file browser will point you to the project directory. If you do not intent to make a project specific lib then it is highly suggested to select a different location. Much more details see above.

After this you will be presented with the option to add the library to either the local or global library table. Select whatever is appropriate for you usecase. See above for details.


For version 5.1.x read the previous section

Making a new Footprint Library in KiCad version 5.0.x and earlier

A limitation of kicad version 4 is that one can not add an empty lib to the fp-lib-table. (Some versions of kicad 4 crash if they encounter an empty lib) meaning we will need to create a temporary footprint and create a new lib using it. This is fixed in version 5.

Starting completely from scratch

  1. Click the button “new footprint” (also found under the file menu entry)
    • Alternatively you can use import footprint here if you want to create a new library from a footprint you downloaded from the web.
  2. Give your new footprint the desired name
  3. Save your footprint to a new lib via the button in the top toolbar or again via the entry in the file menu. (Save footprint in new library)
  4. Select the location and name of your new lib. (The ending .pretty will be added automatically if you omit it.)
  5. Add your lib to either the global or local fp-lib-table using the library wizard. (preferences->footprint library wizard.)
    • in the first page select “Files on my computer”
    • Second page is where you navigate to your new lib
    • Last page is where you select global or project local fp lib table.
      • Local means only visible in the current project, global of course is visible in all your projects.
      • If you use global, be aware that users with whom you share your project also need to add the libs to their config. (happens automatically with project local fp lib table entries.)
    • If you want to use path variables you need to use the footprint library manager (also found in the preferences menu)
      • There you can first append the lib with the wizard and afterwards edit the path to include your environment variable. Syntax: ${ENV_VARIABLE_NAME}
  6. Set your new lib as active as usual. (File menu or top left button in the top toolbar)
  7. Create your footprint as desired.

Starting from an existing footprint

  1. Open the footprint you want to copy
    • Option 1: Via the footprint browser
      • Click the “open footprint from library” button (you don’t need an active lib for this to work)
      • Click select by browser
    • Option 2: list all footprints of a lib and select from there (with text filter)
      • Set the lib containing your footprint as active
      • Click the “open footprint from library” button
      • Click “List all”
      • The opened dialog lists all footprints available in the active lib (in all libs in none is active) Use the text field to filter by footprint name
  2. Use “save footprint to new lib” to create your new library containing this footprint.
    • Sadly you can only specify the lib name not a new name for the footprint
    • Renaming the footprint can only be done after you have your new lib as active lib. (use the save footprint in lib button to save it under a new name. And use the delete footprint dialog to delete the old footprint.)
    • Follow the steps 3 to 7 from the “From Scratch” workflow.

You can also use the file browser of your operating system and a text editor to get to the same result.

  1. Navigate to the .pretty directory containing your source footprint.
  2. Copy the footprint(s) you want in your new lib
  3. Navigate to the directory to which you want to add your footprint libraries (Make sure it is one where your user has write access)
  4. Create a new folder (or directory) with name: footprint_lib_name.pretty
  5. Paste your footprint(s)
  6. If you want you can now rename the footprints using the file browser (remember to also change the fp-name within the file using a text editor)
  7. Add the lib to kicad as explained in step 5 of the “From scratch workflow”
1 Like