Skip to Main Content

Citation Guides for Engineers

Why Is Citing Code Important?

Citing code is important for several reasons that support ethical, academic, and practical standards. First, it ensures proper credit and attribution to the original authors or developers. Just like books or journal articles, code represents intellectual work that deserves recognition.

In academic contexts, citing code upholds academic integrity by avoiding plagiarism and clearly distinguishing your own work from that of others. It also plays a vital role in reproducibility, as referencing the exact version or source of code allows others to replicate your process or results accurately.

In addition, citing code enhances transparency and documentation in both research and development. It informs readers or collaborators about the tools, libraries, or algorithms used, supporting clear and traceable workflows.

Most importantly, proper citation may be legally required under certain software licenses, such as MIT or GPL, which often include terms mandating attribution. In this way, citing code helps maintain compliance with licensing agreements and fosters responsible use of open-source resources.

APA Style

Format:

Author, A. A. (Year). Title of code or repository (Version number) [Computer software]. Site Name. URL

Example:

van Rossum, G., & Python Software Foundation. (2023). Python (Version 3.11) [Computer software]. Python.org. https://www.python.org/

Torvalds, L. (2023). Linux kernel source code (Version 6.1) [Source code]. GitHub. https://github.com/torvalds/linux

GitHub Additional Notes

  • Use the author’s real name if available; otherwise, use their GitHub username.
  • If the version number is available, include it.
  • Use [Source code] or [Computer software] as appropriate.
  • Always include the direct URL to the repository

Format:

Author, A. A. (Year). Title of work (pp. xx–xx). Publisher.

Example:

Downey, A. (2015). Think Python: How to think like a computer scientist (2nd ed., pp. 102–105). O’Reilly Media.

NOTE: If shared privately, cite it as a personal communication in-text only (not in the reference list).

In-text example:

(J. Smith, personal communication, May 1, 2025)

IEEE Style

Format:

[#] Author(s), Title of Repository or Code, version (if available), Publisher or platform, Date. [Online]. Available: URL

Example (GitHub Repository):

[1] J. Smith, Data Processing Scripts, GitHub, Apr. 2024. [Online]. Available: https://github.com/jsmith/data-processing

In-text citation:

As shown in [1], the scripts automate the data cleaning process.

Format:

[#] Author(s), Title of Book, Edition (if not first), Publisher, Year, pp. pages.

Example:

[2] A. B. Downey, Think Python: How to Think Like a Computer Scientist, 2nd ed., O’Reilly Media, 2015, pp. 102–105.

If the code isn't publicly available, you can still cite it as a personal communication or describe it in the text. IEEE does not require personal communications in the reference list, but you may include a note such as:

[3] J. Doe, "Personal MATLAB scripts for signal processing," unpublished.

Chicago Style

Format:

  1. Firstname Lastname or Organization, Title of Repository, version number, last modified Month Day, Year, GitHub, URL.

Bibliography:

Lastname, Firstname or Organization. Title of Repository. Version number. Last modified Month Day, Year. GitHub. URL.

Example:

  1. Hadley Wickham, ggplot2, v3.4.1, last modified February 10, 2023, GitHub, https://github.com/tidyverse/ggplot2.

Bibliography:

Wickham, Hadley. ggplot2. Version 3.4.1. Last modified February 10, 2023. GitHub. https://github.com/tidyverse/ggplot2.

Format:

  1. Firstname Lastname, Title of Book (Place: Publisher, Year), page(s).

Bibliography:

Lastname, Firstname. Title of Book. Place: Publisher, Year.

Example:

  1. Allen B. Downey, Think Python: How to Think Like a Computer Scientist (Sebastopol, CA: O’Reilly Media, 2015), 102–105.

Bibliography:

Downey, Allen B. Think Python: How to Think Like a Computer Scientist. Sebastopol, CA: O’Reilly Media, 2015.

Format:

  1. Firstname Lastname, “Title of Code or Script,” unpublished manuscript, Year.

Bibliography:

Lastname, Firstname. “Title of Code or Script.” Unpublished manuscript, Year.

Example:

  1. Jane Doe, “Signal Analyzer in MATLAB,” unpublished manuscript, 2024.

Bibliography:

Doe, Jane. “Signal Analyzer in MATLAB.” Unpublished manuscript, 2024.

In-text citation: (Wickham 2023)

Reference List:

Wickham, Hadley. 2023. ggplot2. Version 3.4.1. Last modified February 10, 2023. GitHub. https://github.com/tidyverse/ggplot2.