The show runs roughly 20 minutes and draws tens of thousands citywide. Crissy Field gives you the widest unobstructed view over the water and enough grass to actually sit down. The Embarcadero is closer to the action but you'll be standing shoulder-to-shoulder from Pier 7 south. Rooftop bars along the waterfront will have ticketed viewing packages — check ahead if that's your route.
Practical notes: BART runs late on the 4th, but every train after 9pm will be packed. If you're coming from the East Bay, get in early and eat dinner first — Muni surface lines on the waterfront will be slow getting out. Don't bother with the Pier 39 garage; it'll be full by 7pm. The Crissy Field lot fills by 8pm. Your best bet is parking in the Marina and walking 15 minutes, or biking in via the bay trail.
Bring a layer. July in SF means 55°F and wind off the water by 9pm, no exceptions.
If you have two hours: arrive at Crissy Field by 8:30pm, find a spot on the grass facing the bay, watch the show, and leave on foot toward the Marina District before the crowds funnel back to the parking lots.

