They both encode the full spike.
The two mRNA front-runners share many commonalities. Both take advantage of modified RNA chemistry to encode the SARS-CoV-2 spike protein with stabilizing mutations added to lock the shape-shifting surface protein into a form easily recognizable to the immune system. Both also use lipid nanoparticle (LNP) delivery systems.
In slightly more (comparative) detail it's also known they both use the same proline substitions, which stabilize the protein:
The S protein is metastable when produced as a recombinant protein and prone to transform from its pre-fusion to a post-fusion conformation, shedding the S1 subunit. However, the S1 subunit is the immunodominant antigen during CoV infections due to its accessibility for immune recognition and it contains neutralizing epitopes mainly on its RBD. Strategies to stabilize the S protein in its pre-fusion conformation and enhance pre-fusion S protein expression are thought to increase the quality and quantity of vaccine-induced antibodies targeting the functionally relevant epitopes on the S1 subunit. Pallesen et al. reported two proline substitutions (2P) at the apex of the central helix and HR1 that can retain the S proteins of MERS-CoV, SARS-CoV and HKU1 in the antigenically optimal pre-fusion conformation. The resulting antigen, S-2P, induced much greater nAb titres than wild-type S protein in mice. Learning from the previous experience with these CoVs, the S-2P design is now being used in several vaccine strategies against COVID-19.
SARS-CoV-2 S-2P (comprising proline substitutions at residues K986 and V987) is used as the target antigen in three gene-based vaccine candidates (mRNA vaccines by Moderna/National Institute of Allergy and Infectious Diseases (NIAID) and BioNTech/Pfizer and a recombinant Ad26 vaccine by Janssen Pharmaceutical Companies) and a protein-based candidate (by Novavax) (Table 1). Moreover, mutation at the cleavage sites in the S protein is also believed to stabilize the pre-fusion conformation of the S protein. S-2P in the Janssen Ad26-vectored vaccine (Ad26.COV2.S) and in the Novavax protein-based vaccine (NVX-CoV2373) contains additional mutations at the S1–S2 polybasic cleavage site from RRAR to SRAG or QQAQ to render it protease resistant, which helps to further stabilize the S protein in its pre-fusion conformation.
As you can see, some other vaccines have additional tweaks to the proteins, but it's not known/said if Pfizer and Moderna's differ in any way in that regrad.
Pfizer has released more data on the exact sequence they used (through the WHO); the published sequence includes the untranscribed stabilizing elements. I don't know if Moderna has publicly released the same level of information (i.e. exact sequence) for a meaningful, detailed comparison.