About this tool
Generate per-language license header comments with year, copyright holder and SPDX identifier for 9 common licenses.
This generator produces the per-file license header comment for a chosen license, language and copyright holder, including the SPDX-License-Identifier line recommended by the REUSE specification. It covers nine common licenses — MIT, Apache-2.0, the GPL/LGPL/AGPL v3 family, MPL-2.0, BSD-3-Clause, ISC and the Unlicense — using each license's own official 'how to apply' header wording where one exists. It is built for developers who need consistent, correctly worded headers across JavaScript, Python, C, HTML, SQL and other comment syntaxes.
Open License Header Generator on AltFTool — it loads instantly in your browser.
Provide your input — an image, text, or data.
Let the tool analyze or generate the result.
Review, refine, and reuse the output wherever you need it.
Uses each license's own appendix text (Apache-2.0, GPL family, MPL-2.0 Exhibit A) rather than paraphrases.
Outputs //, #, --, ;;, %, block /* */ and <!-- --> comments so the header parses in any language.
Adds the machine-readable SPDX-License-Identifier line that license scanners look for.
It is a single machine-readable comment, such as // SPDX-License-Identifier: MIT, that states the file's license using an identifier from the SPDX license list. License scanners, the REUSE tool and the Linux kernel all rely on it, and the REUSE specification recommends pairing it with an SPDX-FileCopyrightText or copyright line in every file.
No. MIT only requires that the copyright notice and permission notice be included in copies of the software, which a LICENSE file at the repository root satisfies. Per-file headers are still good practice because files get copied out of context, and a one-line SPDX identifier plus a copyright line is the widely used minimal form.
Apache-2.0 (its appendix), the GNU GPL, LGPL and AGPL (their 'How to Apply These Terms' sections) and MPL-2.0 (Exhibit A) each publish exact header wording. MIT, BSD, ISC and the Unlicense do not, so for those the standard practice is a copyright line plus the SPDX identifier.
Use the year of first publication, and extend it to a range like 2020-2026 when the file has been modified in later years. The year does not affect the license's validity — copyright arises automatically — but an accurate notice helps establish the protection timeline; consult a lawyer for jurisdiction-specific questions.