Google Copyright Notice Usage

This document describes Google standards for inclusion of copyright notice and author information in Google authored source code. Examples include C++ files, Java files, BUILD files, README files, shell scripts, and Sawzall programs. These standards may be applicable to other forms of written material such as word processor documents and HTML files, but they are not specifically intended to describe proper use in those cases.

A Google copyright notice is optional in all internal source code authored by Google employees and contractors where the contract does not indicate otherwise. While new files do not need a copyright notice, existing copyright notices should be preserved if a file is edited or copied.

It is necessary to apply a Google copyright notice to any source file that is published or shared outside of Google as a component of the file's license header.

IMPORTANT: Do not ever remove copyright headers from non-Google (third-party) authored code.

For a more detailed discussion of this policy see go/copyrightfaq.

If you want to place a notice, the notice must have the following form:

  1. the word Copyright

  2. the year the file was created in full numeric form (e.g., 2010); don't change this if you edit, move, or copy the file.

  3. the author (Google LLC)

  4. All of these must be together on a single line.

Variations

No variations are acceptable.

For example DO NOT use the symbol ©, or the abbreviation Copr. in place of the word Copyright.

The Year

Substitute the appropriate year of creation for "2010" in the examples. For example, if something was first written in 2010, then your statement should look like:

Copyright 2010 Google LLC

There is no need to update the year if the file is just being moved from one place to another.

When making changes to code with an existing copyright notice:

  • Retain earliest copyright year.

  • Update Google Inc. to Google LLC

  • Optionally, add current copyright year.

    so for example,

    Copyright 2010-2017 Google Inc.
    

    becomes

    Copyright 2010-2020 Google LLC
    

NOTE: When a file is re-published with modifications, the copyright notice for that file can (though does not need to be) updated to include the range of years of publication of different versions of that file.

Files Derived From Third Party Code

Files that copy lines of code from third-party files, or that are directly translated or derived from third-party files, must retain any copyright notices present in the third-party file(s). A Google copyright notice can be added to the license header as a separate copyright notice, beneath any existing notices, but above the license text.

Any files that are exact copies of files taken from a third-party source must retain any existing copyright notices and must not include any new copyright notices.

Entirely new, Googler-authored files being added to a project that is forked or derived from a third-party source should use the license header used by other files in the project, omitting any third-party copyright notices. A Google copyright notice can be added to the header above the license text.

Individual Author Information

Before adding author information to the content of a file, consider that revision history already provides a more detailed and accurate record of authorship. No major language style guide at Google recommends adding author information.

For some languages individual author information may be included in a style appropriate to the language. For C++ this usually takes the form of a simple comment following the copyright notice, if present. For Java the author of a top-level class or interface may be indicated by an @author tag in a Javadoc comment. For Python, avoid adding author information. For Go, avoid adding author information; if it is required for some reason, use a simple line comment.

Any author information should start with a Google username, optionally followed by @google.com, (Full Name), or both.

Examples:

username
emailremoved@
username (Googler Name)
emailremoved@ (Googler Name)

Language Specific Examples

C++

// Copyright 2010 Google LLC
// Author: username

Java

// Copyright 2010 Google LLC

package com.google.foo;

/**
 * (Type docs)
 *
 * @author username
 */

Javascript

// Copyright 2010 Google LLC

/**
 * (Type docs)
 *
 * @author username
 */

Go

// Copyright 2010 Google LLC
// Author: username

BUILD, Shell Scripts, Sawzall

# !/bin/bash
# Copyright 2010 Google LLC
# Author: emailremoved@ (Googler Name)

Legalisms

For internal or external code, no copyright notice is legally necessary. The situation is different for code that includes someone else's copyright notice (in google3, all such code should live in third_party).

(Because of this, there is no need to change this document to add new requirements on the copyright notice. Please do not make such changes without explicit approval from emailremoved@)

Before releasing code externally, be sure to follow the instructions at go/releasing. As part of this process, the Open Source team will vet the code and license headers for correctness. While copyrights are optional, other text such as license headers are not, and the guidelines listed above do not deal with them.