String cosmology is a relatively new field that tries to apply equations of string theory to solve the questions of early cosmology. A related area of study is brane cosmology.
 This approach can be dated back to a paper by Gabriele Veneziano that shows how an inflationary cosmological model can be obtained from string theory, thus opening the door to a description of pre-Big Bang scenarios.
 The idea is related to a property of the bosonic string in a curve background, better known as nonlinear sigma model. First calculations from this model showed as the beta function, representing the running of the metric of the model as a function of an energy scale, is proportional to the Ricci tensor giving rise to a Ricci flow. As this model has conformal invariance and this must be kept to have a sensible quantum field theory, the beta function must be zero producing immediately the Einstein field equations. While Einstein equations seem to appear somewhat out of place, nevertheless this result is surely striking showing as a background two-dimensional model could produce higher-dimensional physics. An interesting point here is that such a string theory can be formulated without a requirement of criticality at 26 dimensions for consistency as happens on a flat background. This is a serious hint that the underlying physics of Einstein equations could be described by an effective two-dimensional conformal field theory. Indeed, the fact that we have evidence for an inflationary universe is an important support to string cosmology.
 In the evolution of the universe, after the inflationary phase, the expansion observed today sets in that is well described by Friedmann equations. A smooth transition is expected between these two different phases. String cosmology appears to have difficulties in explaining this transition. This is known in the literature as the graceful exit problem.
 An inflationary cosmology implies the presence of a scalar field that drives inflation. In string cosmology, this arises from the so-called dilaton field. This is a scalar term entering into the description of the bosonic string that produces a scalar field term into the effective theory at low energies. The corresponding equations resemble those of a Brans–Dicke theory.
 Analysis has been worked out from a critical number of dimension (26) down to four. In general, one gets Friedmann equations in an arbitrary number of dimensions. The other way round is to assume that a certain number of dimensions is compactified producing an effective four-dimensional theory to work with. Such a theory is a typical Kaluza–Klein theory with a set of scalar fields arising from compactified dimensions. Such fields are called moduli.
 This section presents some of the relevant equations entering into string cosmology. The starting point is the Polyakov action, which can be written as
 where  
  
    
      
        
           
          
            (
            2
            )
          
        
        R
      
    
    {\displaystyle \ ^{(2)}R}
  
 is the Ricci scalar in two dimensions, 
  
    
      
        Φ
      
    
    {\displaystyle \Phi }
  
 the dilaton field, and 
  
    
      
        
          α
          ′
        
      
    
    {\displaystyle \alpha '}
  
 the string constant. The indices 
  
    
      
        a
        ,
        b
      
    
    {\displaystyle a,b}
  
 range over 1,2, and 
  
    
      
        μ
        ,
        ν
      
    
    {\displaystyle \mu ,\nu }
  
 over 
  
    
      
        1
        ,
        …
        ,
        D
      
    
    {\displaystyle 1,\ldots ,D}
  
, where D the dimension of the target space. A further antisymmetric field could be added. This is generally considered when one wants this action generating a potential for inflation. Otherwise, a generic potential is inserted by hand, as well as a cosmological constant.
 The above string action has a conformal invariance. This is a property of a two dimensional Riemannian manifold. At the quantum level, this property is lost due to anomalies and the theory itself is not consistent, having no unitarity. So it is necessary to require that conformal invariance is kept at any order of perturbation theory. Perturbation theory is the only known approach to manage the quantum field theory. Indeed, the beta functions at two loops are
 and
 The assumption that conformal invariance holds implies that
 producing the corresponding equations of motion of low-energy physics. These conditions can only be satisfied perturbatively, but this has to hold at any order of perturbation theory. The first term in 
  
    
      
        
          β
          
            Φ
          
        
      
    
    {\displaystyle \beta ^{\Phi }}
  
 is just the anomaly of the bosonic string theory in a flat spacetime. But here there are further terms that can grant compensation of the anomaly also when 
  
    
      
        D
        ≠
        26
      
    
    {\displaystyle D\neq 26}
  
, and from this cosmological models of a pre-big bang, scenario can be constructed. Indeed, this low energy equations can be obtained from the following action:
 where 
  
    
      
        
          κ
          
            0
          
          
            2
          
        
      
    
    {\displaystyle \kappa _{0}^{2}}
  
 is a constant that can always be changed by redefining the dilaton field. One can also rewrite this action in a more familiar form by redefining the fields (Einstein frame) as
 and using 
  
    
      
        
          
            
              Φ
              ~
            
          
        
        =
        Φ
        −
        
          Φ
          
            0
          
        
      
    
    {\displaystyle {\tilde {\Phi }}=\Phi -\Phi _{0}}
  
 one can write
 where
 This is the formula for the Einstein action describing a scalar field interacting with a gravitational field in D dimensions. Indeed, the following identity holds:
 where 
  
    
      
        
          G
          
            D
          
        
      
    
    {\displaystyle G_{D}}
  
 is the Newton constant in D dimensions and 
  
    
      
        
          M
          
            p
          
        
      
    
    {\displaystyle M_{p}}
  
 the corresponding Planck mass. When setting 
  
    
      
        D
        =
        4
      
    
    {\displaystyle D=4}
  
 in this action, the conditions for inflation are not fulfilled unless a potential or antisymmetric term is added to the string action, in which case power-law inflation is possible.