Creating Open and FAIR Code Yourself
Developing code in a way that makes it open and easy to reuse from the outset can save time and effort later on – for example, when publishing your code or when others want to build on your work. (As a reminder: Open does not necessarily mean FAIR, and FAIR does not necessarily mean Open.) The following recommendations highlight what to consider when creating Open and FAIR Code.
1. Creating OPEN Code
What to consider during development
- Choose an open programming language: Whenever possible, opt for an open programming language, such as Julia, Python, or R. For tips and resources on getting started with R, see this blog post.
- Use version control: Manage your code using version control, for example on GitHub or GitLab. This makes changes traceable and facilitates collaboration with others.
- Organise your code clearly: Use consistent and descriptive file and folder names (see these tips on project organisation). Also ensure that your code is readable and well documented, and create a README file explaining the purpose of your code and how to use it.
- Use open formats: Whenever possible, read and store data in open standard formats, such as CSV rather than proprietary formats like .dta or .xlsx.
- Document dependencies: Keep track of the packages and software versions your code requires, for example in a
renv.lockorrequirements.txtfile. For more complex requirements, consider using a code notebook or a container-based execution environment.
What to consider when publishing your code
- Choose an open licence: Select a suitable open licence and include it as a
LICENSEfile in your repository. The licence specifies how others may use, modify, and redistribute your code. - Make your code publicly available: Publish your code in a publicly accessible repository, for example on GitHub or GitLab. Make sure not to disclose any confidential information or personal data.

Your code is now Open. To make it findable, citable, and easy to reuse in the long term, you should also consider the FAIR principles.
2. Making Code FAIR
- Findable: Add machine-readable metadata so that your code can be clearly described and discovered. For example, use a
CITATION.cfforcodemeta.jsonfile. Where possible, include all authors' ORCID identifiers. - Accessible: Ensure that your code remains accessible through a persistent link. Publish a specific version of your code (a release) and archive it, for example, on Zenodo. Zenodo assigns a Digital Object Identifier (DOI), which allows that specific version to be persistently referenced.
- Interoperable: Whenever possible, use open, standardised data formats and avoid proprietary dependencies. Also follow established standards and conventions used by your research community.
- Reusable: Document your code so that others can understand and use it. In particular, provide information about required packages, software versions, and execution conditions. Also make sure that the licence, authorship, and citation information are clearly stated.
Practical guidance: Making Your Code FAIR in 11 Steps
The checklist How to Make Your Code FAIR in 11 Steps guides you through the process of making your code FAIR, step by step.
Skip to PDF content