Share this page:

Citing Open Code

To comply with good research practice, it is essential to correctly cite the ideas and work of others. In a scientific context, this naturally also applies to code (and software). Citing code also ensures that the creation of Open Code is appropriately recognised. You should therefore generally cite code developed by yourself or provided by third parties that has made an important contribution to your research work, provided that it has been published accordingly. Just like code, you can of course cite software that you use in your research.

If you cite code or software, you should include at least the following:

  • the name of the author,
  • the title of the software or code,
  • the version number, the publication date and the unique identifier (PID).

 

Dekoratives Element // Decorative element

 

Platforms such as Zenodo already offer a suggestion for a citation. In practice, an example of a citation looks like this:

Lars Vilhuber. (2024). AEADataEditor/docker-aer-2023-0700: Docker image for software stack used in AER-2023-0700. In American Economic Review (Version v20240429). AEA Data Editor. https://doi.org/10.5281/zenodo.11094339

or so:

Karbownik, K., & Wray, A. (2022). Replication package for "Lifetime and intergenerational consequences of poor childhood health" (1.0). Zenodo. https://doi.org/10.5281/zenodo.7117307 

Ideally, as can be seen in the examples, you have a PID, for example in the form of a DOI, which you can use. You should also bear this in mind if you publish code yourself.

If you use a code repository such as GitHub or GibLab, the URL structure allows you to refer to a specific version or a specific release.

For GitHub, the citation to a version (referred to here as a commit) would look like this, for example:

OpenSourceEconomics. (2024). estimagic (Commit f430f807cebcb3ce71265a24fe6936db1b821faf) [Source code]. GitHub. https://github.com/OpenSourceEconomics/estimagic/commit/f430f807cebcb3ce71265a24fe6936db1b821faf

or to a specific release (referred to here as a tag):

OpenSourceEconomics. (2023). estimagic (Tag 0.4.6) [Source code]. GitHub. https://github.com/OpenSourceEconomics/estimagic/tree/v0.4.6

Software Heritage offers another option for precisely and permanently citing code. By archiving a repository there, you receive a Software Hash Identifier (SWHID)—a content-based, persistent identifier that precisely encodes what is being referenced, regardless of the hosting platform. A key advantage of SWHIDs over GitHub URLs is their level of detail: they can reference not only a specific version or file, but even individual lines within a source file. This makes it possible, for example, to cite exactly the lines of code that implement a specific algorithm. For example, a citation would look like this:

GAMA Platform developers. (2026). GAMA Platform (Version as archived). Software Heritage. https://archive.softwareheritage.org/swh:1:rev:054f5908807163e0bfd35623bf1a4f969254ea02

Of course, it is also possible for authors to leave information on correct citation, for example in a README file.

Further information on basic principles for citing code or software can also be found in the FORCE 11 Software Citation Principles.

Tip

Tip: Cite your own code where possible.