[¶ 1] U.S. Bank, as Trustee of the Washburn Trust No. 1, appeals from a summary judgment quieting title to the coal under a quarter section of land to Donald Koenig, Robert Koenig, James Koenig, Eilene Doble, and Joy Person (“Koenigs”). We construe a 1906 warranty deed conveying the land from U.S. Bank’s predecessor in interest to the Koe-nigs’ predecessor in interest to reserve the coal to U.S. Bank’s predecessor. We reverse and remand for entry of judgment consistent with this opinion.
I
[¶ 2] In a 1906 warranty deed, William and Lizzie Washburn, U.S. Bank’s predecessors in interest, conveyed a quarter section of land to Emil Borchardt, the Koe-nigs’ predecessor in interest. The original 1906 deed is not part of this record, but the county recorder’s record for the conveyance identified the Washburns, the grantors, as the “parties of the first part” and Borchardt, the grantee, as the “party of the second part,” and provided:
*822said second party reserving and excepting therefrom all coal now or hereafter to be found in said land, also the right and title to the use of such surface ground as may be necessary for mining operations, and the right of access to such reserved and excepted coal for the purpose of exploring, developing, working and removal of the same. •
[¶ 3] U.S. Bank commenced this quiet title action against the Koenigs, claiming the reservation clause entitled it to the coal. U.S. Bank alleged the warranty deed contained a “scrivener’s error, or an error in transcription of the original deed into the record, in that it states ‘said second party reserving and excepting therefrom all coal,’ whereas the reservation must necessarily have been to [the Wash-burns], the parties of the first part, who made the grant.”1 The Koenigs, successors in interest to ninety-five percent of the interest acquired by Borchardt, claimed they owned ninety-five percent of the coal under the land because the warranty deed did not effectively reserve the coal to the Washburns.
[¶ 4] U.S. Bank and the Koenigs both moved for summary judgment. U.S. Bank argued, as a matter of contract interpretation, there was “no question that the parties intended [the reservation] clause to reserve all of the coal to the grantors and that the term ‘said second party’ at the beginning of the clause was inadvertently substituted for the term ‘said first party,’ since the party of the second part in a deed, that is the grantee, cannot reserve something which he does not own and cannot except something from the grant being made to him by the grantor.” The Koenigs argued that U.S. Bank failed to offer any evidence to clearly and convincingly establish grounds for reformation of the 1906 deed.
[¶ 5] The trial court concluded U.S. Bank failed to establish that the language in the coal reservation constituted a mutual mistake and that the written instrument did not truly express the parties’ intent. The court decided U.S. Bank could not sustain the burden of proof necessary for reformation or revision of the warranty deed and granted summary judgment for the Koenigs.
II
[¶ 6] U.S. Bank argues the proper interpretation of the warranty deed establishes its predecessor in interest, the Washburns, reserved and excepted the coal from their conveyance to the Koenigs’ predecessor in interest. U.S. Bank argues extrinsic evidence is not necessary to determine the parties’ intent because the only possible meaning for the reservation clause is to reserve the coal to the Wash-burns.
[¶ 7] The issues in this appeal are raised in the posture of summary judgment, which is a procedural device for resolving a controversy on the merits without a trial if the evidence demonstrates there are no genuine issues of material fact, or inferences to be drawn from undisputed facts, and if the evidence shows a party is entitled to judgment as a matter of law. Bender v. Aviko USA L.L.C., 2002 ND 13, ¶ 4, 638 N.W.2d 545.
[¶ 8] Except as otherwise provided in N.D.C.C. ch. 47-09, grants are interpreted in the same manner as contracts. N.D.C.C. § 47-09-11. Contracts are construed to give effect to the parties’ mutual intent at the time of contracting. *823N.D.C.C. § 9-07-03; Haag v. Noetzelman, 1999 ND 157, ¶ 6, 598 N.W.2d 121. The parties’ intent must be ascertained from the writing alone if possible. N.D.C.C. § 9-07-04; Haag, at ¶ 6. The parties’ intent must be ascertained from the entire instrument, and every clause, sentence, and provision should be given effect consistent with the main purpose of the contract. Haag, at ¶ 6. Under N.D.C.C. § 9-07-17, “[rjepugnancy in a contract must be reconciled, if possible, by such an interpretation as will give some effect to the repugnant clause subordinate to the general intent and purpose of the whole contract,” See Northwest G.F. Mut. Ins. Co. v. Norgard, 518 N.W.2d 179, 184 (N.D.1994). Grants in a contract are interpreted in favor of the grantee, except a reservation in any grant is interpreted in favor of the grantor. N.D.C.C. § 47-09-13. If the parties’ intent can be ascertained from the writing alone, the interpretation of the contract is entirely a question of law, and we independently examine and construe the contract to determine if the trial court erred in its interpretation of the contract. Haag, at ¶ 6.
[¶ 9] In Perschke v. Burlington Northern, Inc., 311 N.W.2d 564, 565 (N.D.1981), this Court considered a similar issue regarding the interpretation of a 1906 deed that conveyed a tract of land and “reserved and excepted coal and iron lands.” Perschke, the successor in interest of the grantee, argued the reservation reserved the coal and iron lands, surface and all, and not just the coal and iron itself, and thus was void as repugnant to the grant. This Court construed the word “lands” to mean “interests,” so the deed reserved the coal and iron interests in the property conveyed without reserving the surface interests:
In construing the reservation clause of the 1906 deed we must strive to give effect to the mutual intention of the parties as it existed at the time, so far as that intent is ascertainable and lawful. Section 9-07-03, N.D.C.C. Perschke urges us to interpret the clause as reserving coal and iron property, surface and all, with the ultimate effect of voiding the entire reservation for being repugnant to the grant. We are unpersuaded that Perschke’s interpretation would give effect to the mutual intention of the parties. Upon examining the reservation it is quite obvious that the grantor was attempting to at least reserve for itself all coal and iron interests in the property granted, but under Perschke’s interpretation of the clause the grantor and its successors in interest would have effectively reserved nothing. That interpretation of the clause would also be contrary to the rule that reservations must be interpreted in favor of the grantor. Section 47-09-13, N.D.C.C.; Gilbertson v. Charlson, 301 N.W.2d 144 (N.D.1981).
In the instant case, as in Carlson [v. Minnesota Land & Colonization Co., 113 Minn. 361, 129 N.W. 768 (1911)], the reservation clause expressly reserves “the use of such surface ground as may be necessary for mining operations.” We agree with the Minnesota Supreme Court that if the grantor was attempting to reserve the coal and iron property, surface and all, there would be no reason for it to have reserved the use of the surface for mining operations. In construing a contract or deed we must construe all provisions together and give meaning to every sentence, phrase and word. Section 9-07-06, N.D.C.C.; Delzer Construction Co. v. New Marian Homes Corp., 117 N.W.2d 851 (N.D.1962). If we were to interpret the reservation as reserving the coal and iron property, surface and all, the phrase “reserving ... the use of such surface *824ground as may be necessary for mining operations” would be meaningless. Perschke explains that in addition to reserving the coal and iron property the grantor, by reserving the use of the surface ground, was attempting to insure that he had access to the reserved property. We are not convinced that Perschke’s explanation gives meaning to the language which reserves use of the surface, because the clause also contains language expressly reserving a right of access to the reserved “coal and iron lands.”
In accord with the foregoing analysis we construe the reservation clause of the 1906 deed as reserving the coal and iron interests in the property conveyed without reserving the surface interests of the property. In so construing the clause we have interpreted the term “lands” as meaning “interests.” We believe that our construction gives the term “lands” consistency throughout the clause, gives meaning to every sentence and phrase of the clause, and correctly ascertains the intention of the parties to the deed at the time of its execution.
Perschke, at 567.
[f 10] Here, the county recorder’s records identified the grantee, Bor-chardt, as the “party of the second part,” but the reservation clause said the “second party” reserved and excepted all coal. The reservation clause also said the “second party” reserved and excepted the right and title to the surface for mining operations and for access to the reserved and excepted coal. Under our rules for construing deeds, any uncertainty about the reservation must first be resolved from the four corners of the deed by giving meaning to each word, sentence, and provision in a manner that is consistent with the purpose of the deed. See Haag, 1999 ND 157, ¶ 6, 598 N.W.2d 121. Construing the reservation clause to reserve the coal to the grantee would render the reservation clause meaningless. We construe the deed and the reservation clause as a whole in favor of the grantor to give meaning to each word and phrase and to reconcile repugnant words in a manner consistent with the intent and purpose of the deed. See Perschke, 311 N.W.2d at 567. Under those rules of construction, we construe the deed to reserve the coal to the grantors, the Washburns. That interpretation construes the reservation in favor of the grantor, see N.D.C.C. § 47-09-13, reconciles repugnant words in a manner that is subordinate to, and consistent with, the general intent and purpose of the deed, see N.D.C.C. § 9-07-17, and gives meaning to every clause, sentence, and provision in the deed. See Haag, at ¶ 6; Perschke, at 567. We conclude the parties to the 1906 deed intended that the Washburns reserved and excepted the coal from their conveyance to Borchardt. Because we conclude the parties’ intent can be ascertained from the document itself, the interpretation of the deed is a question of law for the court to decide, see Haag, at ¶ 6, and legal principles regarding reformation are not applicable to our interpretation.
Ill
[¶ 11] We reverse the summary judgment and remand for entry of judgment consistent with this opinion.
[¶ 12] GERALD W. YANDE WALLE, C.J., MARY MUEHLEN MAKING, WILLIAM A. NEUMANN, and GEORGIA DAWSON, D.J., concur. [¶ 13] The Honorable GEORGIA DAWSON, D.J., sitting in place of SANDSTROM, J., disqualified.. In 1941 N.D. Sess. Laws ch. 234, the Legislature authorized the use of photography for making permanent county records. See Rausch v. Nelson, 134 N.W.2d 519, 526 (N.D.1965) (construing photography to include microfilm).