ToolCraft
HomeAI ToolsDeveloper ToolsUnit ConverterImage Tools
ToolCraft

© 2026 ToolCraft. All rights reserved.

Privacy PolicyTerms of Service
DMCA.com Protection Status
HomeLegal & ComplianceLicense Header Inserter

Legal & Compliance

OSS License PickerPrivacy Policy GeneratorCookie Banner GeneratorLicense Header Inserter

License Header Inserter

Prepend a license header to source code in JS/TS/Python/Go/Rust/Java/C/CSS/HTML — SPDX, short, or full text.

Ctrl+Shift+CCopy output

3-8 lines pointing to LICENSE file. Best balance of clarity and brevity.

Used to detect language from extension. Doesn't modify your file.

Header preview

// Copyright (c) 2026 Your Name
//
// Released under the MIT License (https://opensource.org/licenses/MIT).
// See LICENSE for full text.

Original code

Output (with header)

// Copyright (c) 2026 Your Name
//
// Released under the MIT License (https://opensource.org/licenses/MIT).
// See LICENSE for full text.

function fibonacci(n) {
  if (n <= 1) return n;
  return fibonacci(n - 1) + fibonacci(n - 2);
}

console.log(fibonacci(10));

View all Legal & Compliance

View all
100% offline
New

OSS License Picker

Pick from 8 popular open-source licenses (MIT, Apache 2.0, GPL-3, BSD, MPL 2.0, ISC, Unlicense). See permissions / conditions / limitations side-by-side, then download a ready-to-commit LICENSE file.

Legal & Compliance
100% offline
New

Privacy Policy Generator

Build a privacy policy in Markdown for Generic / GDPR (EU) / CCPA (California) / Vietnam Decree 13 from a short form.

Legal & Compliance
100% offline
New

Cookie Banner Generator

Build a self-contained HTML+CSS+JS cookie consent banner — no framework, no CDN. Exposes window.cookieConsent API.

Legal & Compliance

License Header Inserter — 8 languages, 3 header styles

Adding a license notice to every source file is the conventional way to make ownership and licensing terms unambiguous in a multi-author project. The SPDX initiative (used by the Linux kernel, npm, the European Commission, and many corporate tooling pipelines) standardized this into a single one-liner — "SPDX-License-Identifier: MIT" — that machine-readable license scanners parse without ambiguity. The License Header Inserter prepends one of three header styles to your source: SPDX (one line), short (3–8 lines pointing readers to the LICENSE file), or full (the entire license text inlined). It handles the right comment syntax for each of 8 languages: // for JS/TS/Go/Rust, # for Python, /* */ for Java/C/CSS, <!-- --> for HTML. It preserves shebangs (#!/usr/bin/env python) and the HTML doctype as the very first line, inserting the header below them. Paste-and-go workflow: drop your file content in, pick license + holder, copy the output back. For batch processing across hundreds of files, generate the SPDX header for the right language combination and use it as a template in a sed / ripgrep / shell script.

When to pick which style

SPDX ID is the right default for new projects: tools parse it cleanly, files stay short, the license-detection step in your CI passes without parsing prose. Short notice is the historical default for files in mid-sized OSS projects — explicit copyright line + brief license summary + pointer to LICENSE. Full text is reserved for the LICENSE file itself and a few jurisdictional cases (the Apache License recommends the full notice in every source file as a defensive measure, though most projects ignore that recommendation today). Whatever you pick, be consistent across the codebase — mixing styles makes automated license auditing harder.

FAQ