Even though copyright offers creators strong protections over their works, there are several exceptions. "Fair use" is the most famous of these.
The idea that some uses should be allowed even though they may be contrary to the interests of the owner comes from the purpose of copyright itself. The Constitution tells us that copyright exists to "promote the advancement of the useful arts." If authors had absolute rights to protect their works, people could not create new works that build on them in any way, or use the works in ways that the author does not permit. Fair use carves out a space where one can use copyrighted works when they benefit everyone.
17 U.S.C. §107 lays out the four factors to consider when making a fair use determination. Importantly, no single factor is determinative and in every case, there will be some facts that weigh for fair use and some that weigh against. Your job is to balance all of the factors to determine whether fair use will apply in your case.
Factor 1: "The purpose and character of the use, including whether such use is of a commercial nature or is for nonprofit educational purposes"
This factor looks at why you are copying the work and what you are doing with it. Things like education, scholarship, research, and commentary weigh for fair use. Commercial/for-profit uses weigh against.
Factor 2: "The nature of the copyrighted work"
This factor looks at the type of work that you are copying, including whether the work is published or unpublished, or if the work is fiction or non-fiction. Uses of published works are more likely to be fair use than of unpublished works; uses of non-fiction works are more likely to be fair use than of fiction works.
Factor 3: "The amount and substantiality of the portion used in relation to the copyrighted work as a whole"
This factor considers both the percentage of a work you are copying and how important that part is to the whole work. So, using a small piece of a work, or a piece that is unimportant to the work as a whole favors fair use; using a large amount of a work or a piece that is the "heart" of the work weighs against fair use.
Factor 4: "The effect of the use upon the potential market for or value of the copyrighted work"
This factor asks you to look at how your use affects the market for the work. One way to think about this is to ask whether the use takes profits from the copyright owner or in some way hurts a potential market for the copyrighted work.
One of the most important things to consider when deciding if a use is fair is whether the use is "transformative."
Does the new use do something different than the original work, rather than simply replacing it? If a use merely replaces the old work, then it is a "copy", whereas if it "transforms" the original work into something new, then it is something other than a mere reproduction.
Consider, for example, a parody version of an original song. The parody may copy all of the music and some of the lyrics from the original, but then takes those pieces and does something new and different by using them for comedy, commentary, etc. Both the original and the parody can exist as something unique, even though they share many of the same features. The new use does not simply replace the original. Instead, the parody "transforms" it.
Below are some resources that can help you better understand fair use and the four factor test.