I know that you can make parts of a project open source and keep other parts colosed source.

Suppose I have a peice of software and I only make 1 line of the code in the software open source.

My question:

Can I classify this as open source?

If yes, are there any limits to this?

If no, why not? How do you know if it is? It it percentage based?


3 Answers 3


Yes you can distribute one line of code as "open source software" by assigning that one line of code an OSI Approved Open Source License.

You should only label your software as "open source software" (i.e. tell everyone it is open source) if you distribute it with an OSI Approved License. Calling it open source is meaningless--the license determines if it is open source software, not a marketing campaign.

The license you assign to your work not only determines if it is open source software, but--per your second question--how others may distribute derivatives of your work: either only as open source software (for example through the GPL family of licenses) or with proprietary software (for example through the Apache, BSD, or MIT licenses).

So if you distribute your one line of code with a GPL-like "copyleft" license, anyone who modifies your one line will also need to distribute their edits under the same, open source (GPL) license.

If, for example, you were to assign the BSD License to your one line of code, anyone can take that line of code and include it with their proprietary software and even sub-license it (as long as they include the copyright information in their distribution).

Any software distributed with an OSI Approved Open Source License is "open source software."

Software NOT distributed with an OSI Approved License, but labelled as "open source software" should be considered suspect.

A great resource for learning about various open source licenses and their permissions/restrictions is, TL;DR Legal

  • 2
    You don't seem to explicitly say that the entire software won't be considered open source, which seems to me like the main question.
    – overactor
    Commented Jul 8, 2015 at 4:49
  • 1
    Hmm, I think I might have read the question wrong. My interpretation was that the author created a one line program and wanted to include that program in a larger package to be distributed. The same user posted a single line question as well (opensource.stackexchange.com/questions/927/…). Is this one redundant?
    – massonpj
    Commented Jul 8, 2015 at 11:44
  • As well as the it is not Free Software unless it is 100% Free Software (“it is only a small chain”), argument as stated by @overactor. You must also consider that it may be a licence infringement (depending on the license of the Free/Open software component). Commented May 13, 2017 at 10:34

All of it.

"Open source" reasonably refers to strictly to that set of instructions (here, source code) that is made available under the applicable (open source) license.

If you have a project with two components A and B, and only component B is open source while component A is proprietary, then the project is not open source. How could it be, when a third party does not have rights to use, alter, redistribute, etc. the project in its entirety?

If you're interested in advertising that a project is open source but unable to actually release all of its components under an open source license, I see a few options.

  1. Simply state the truth—that the project includes or incorporates some open source components.
  2. Organize the open source components of the project into a coherent set and give it a name that is very similar to the name of the entire project (but distinguishable); refer to this set of components as open source, and hope people associate your "Open Source Project X Core" with your entire "Project X." This has the potential to mislead, depending on how you do it and whether the open source components of the project are reasonably separable from the rest.
  3. Call it open source anyway. You'll fool some people and anger others. Not recommended.

Strictly speaking, already the smallest part being not open source makes the whole not open source, as the whole package now fails to follow the 10 rules in the Open Source Definition. In practice though, if only small parts are not open source it will still be called open source by most, and if only small parts are open source it will be called not open source by most.

For example, Firefox is called mostly an open source project, as the parts that aren't are miniscule in comparison to the whole project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.