Main

Efforts to compute stellar limb darkening go back over a century to the classical work of Schwarzschild1 and Milne2. The knowledge of limb darkening is required for numerous astrophysical applications, for example, measurements of stellar diameters with interferometry3, the interpretation of light curves of eclipsing binary stars4 and spotted stars5, and the interpretation of the centre-to-limb effects observed in local helioseismology6,7.

An iconic modern-day application of limb darkening is for transit light-curve fitting to derive planetary radii with transit photometry and atmospheric composition with transmission spectroscopy8,9,10. It relies on the description of stellar limb darkening, which alters the transit profile and depth. Yet there is a conundrum: stellar atmosphere models indicate a substantially stronger drop of the brightness towards the stellar limb than multiple sensitive observations show. This point is made clear by analyses of Kepler and Transiting Exoplanet Survey Satellite (TESS) transit light curves11,12. Further observations include that of α Centauri13 with the Very Large Telescope Interferometer (VLTI) and, most recently, that of WASP-3914 with the James Webb Space Telescope (JWST.) In particular, ref. 12 compared observed and modelled limb darkening in 33 Kepler and 10 TESS stars with transiting exoplanets. It was found that although all theoretically computed limb darkenings, including those based on MPS-ATLAS15, ATLAS16,17,18, PHOENIX19, STAGGER11 and MARCS20 model atmospheres, are in relatively good agreement with each other, they all indicate a steeper drop of the stellar brightness from the centre of a stellar disk towards its limb than observations.

One response to this mismatch has been to include empirical limb-darkening coefficients for each wavelength bin as free parameters when fitting transit light curves21. However, increasing the number of free parameters introduces biases and additional uncertainties in the determination of the planetary radius21,22,23,24. The problem has been raised to a new level with the advent of the JWST25. The extreme precision transmission spectroscopy data obtained by this telescope require a more accurate transit analysis, which in turn calls for improved theoretical modelling of limb darkening. Similar precision is also anticipated from the Atmospheric Remote-sensing Infrared Exoplanet Large-survey (ARIEL)26 (launch expected in 2029).

Here we show that stellar surface magnetic fields measurably affect limb darkening. The magnetic effect is bound to manifest itself in the available observations as all stars on the lower main sequence are intrinsically magnetic27. Some of these magnetic fields are generated deep within the stellar convective zone by the action of a global stellar dynamo28. Another important component of the stellar surface magnetic field results from the action of a near-surface small-scale turbulent dynamo (SSD)29. Such an SSD fills nearly the entire stellar surface with considerable magnetic flux, thus producing a minimum level of magnetic activity30,31,32,33. The turbulent magnetic fields produced by the SSD are always present at the stellar surface independently of the action of the global stellar dynamo and they also modify the stellar photospheric structure32,33 (relative to the hypothetical non-magnetic case). Large concentrations of surface magnetic field, resulting from the action of the global dynamo, form active regions (containing, for example, dark spots). While spots produce an offset of the transit curve34, the effect from the spots is not visible on stellar limb darkening unless the planet crosses them during the transit. Smaller concentrations of field resulting from both global and small-scale dynamos lead to the formation of a more homogeneous magnetic network present all over the star, so that a transiting planet always crosses it. In the present study, we show that the mismatch between simulations and Kepler35 measurements disappear after accounting for the effect of the magnetic network on the limb darkening.

Results

The noted discrepancy between high-precision observations and models is showcased in Fig. 1 by a comparison of the observations (where we refer to the average over the Kepler sample) with the reference grid of non-magnetic limb darkening, which shows an offset. To quantitatively describe the offset, we compute the observations–model differences in limb-darkening coefficients used to parameterize limb darkening12. One, \({h}_{1}^{{\prime} }\), effectively describing the drop in star brightness from disk centre to about 0.75 of the stellar radius (corresponding to μ = 2/3, where μ is a cosine of the heliocentric angle, which is an angle between the line of sight and the normal to the local surface), another, \({h}_{2}^{{\prime} }\), the drop from 0.75 to 0.95 (μ = 1/3) of the stellar radius (see top-right corner in Fig. 1). Observations from Kepler are averaged over tens of stars to increase the signal-to-noise ratio. The model values are taken from the one-dimensional (1D) MPS-ATLAS spectral library15,36 (namely, SET 1 from this library, hereafter referred to as REFLD). By computing the observations–REFLD differences, we quantify the limb-darkening conundrum, which we solve by adding the effect of magnetic field.

Fig. 1: Limb darkening in the Kepler passband.
figure 1

The x and y axes express the difference in the limb-darkening coefficients (\({h}_{1}^{{\prime} }\) and \({h}_{2}^{{\prime} }\)) between two sources: one source is always the models without magnetic fields (REFLD) and the other can be models with either fields or observations. The points marked by a cross correspond to the data averaged over the full sample of Kepler stars (green) and over a selected sample including the stars with metallicities −0.1 < M/H < 0.1 and transits with an impact factor less than 0.5 (blue). The error bars represent s.e.m. These points show the mean offset between measurements12 and REFLD15. The star symbols are our calculations based on MURaM simulations (that is, offsets between our calculations and REFLD) for different magnetization levels (see legend; HD, SSD, 100 G, 200 G, 300 G) in the Kepler passband. The sketch in the right upper corner illustrates the definition of the limb darkening coefficients, where Ic represents the intensity at the disk center, I2/3 represents the intensity at μ = 2/3 and I1/3 represents the intensity at μ = 1/3. All intensities are normalized to the intensity at the disk center. The solar symbol (Sun) is the measured solar limb darkening in the Kepler passband15. Our stellar atmosphere models, which include magnetic fields, match both the solar and the stellar observations and provide an explanation for the offsets between Kepler limb darkening relative to models without magnetic field.

The primary finding of this study is that the offset between models and observations can be explained by a stellar surface magnetic field. To demonstrate this, we simulated limb darkening as it would be observed for a hypothetical individual star with different levels of magnetization. We find that a star with magnetic fields of about 100 G has the same offset with respect to non-magnetic models as the averaged Kepler observations (Fig. 1). This means that by applying 100 G magnetic field to simulations, we can reconcile them with the observations. This field of about 100 G then corresponds to the averaged magnetization of stars in the Kepler sample.

Our second major finding is that individual stars with the same fundamental parameters (that is, effective temperature, metallicity and surface gravity) will have different limb darkening depending on their magnetization (Fig. 1). This is in stark contrast to what was assumed before. Specifically, we find a clear trend that stars with higher magnetic fields are less dark towards the limb than stars with lower magnetic fields. This is a measurable effect with current high-precision data (see ‘Discussion’). Thus, the measurement of limb darkening opens a new way to measure star surface magnetic fields.

Our modelling approach combines the strengths of 1D and three-dimensional (3D) approaches to stellar atmospheric modelling because each one has its own benefits needed to compute limb darkening. We first use the REFLD grid based on 1D models of stellar atmospheres to get limb darkening on stellar fundamental parameters. Then we use 3D models computed with the radiative magnetohydrodynamic (MHD) code MURaM37 to account for the effect of magnetic field (and realistic treatment of convection). The 1D models are imperative because limb darkening has a strong dependence on stellar fundamental parameters15,17, and the 1D models are computationally cheap enough to be generated on a very fine grid of these parameters. In the present study, we used the REFLD grid for stars with specific fundamental parameters from the considered Kepler sample. One drawback of the 1D approach is that it relies on the parameterized treatment of convection with the mixing length approximation38 and is intrinsically incapable of accounting for the magnetic field.

To account for the magnetic field, we use 3D MHD models because they allow realistic simulations of near-surface magnetoconvection. The 3D models are too computationally expensive to be produced on a grid of fundamental parameters sufficiently fine to allow reliable interpolations to stars of interest or for each of the stars individually. At the same time, our analysis of recent MURaM simulations32,33,39 of magnetized atmospheres of stars with different fundamental parameters shows that the magnetic effect only weakly depends on stellar fundamental parameters and, thus, can be calculated on a rather coarse grid. Moreover, the stars in the considered Kepler sample have near-solar fundamental parameters, so for the purposes of the present study we restrict MURaM simulations (and their post-processing) to the solar atmosphere. In a forthcoming publication, we will extend our investigation to a broader sample of stars.

Our calculations of the magnetic effect on limb darkening are performed in two steps. In the first step, we simulate the magnetized stellar atmosphere with the MURaM code. MURaM is capable of self-consistently simulating the contribution from the action of an SSD29,32,33,40. The effect of magnetic fields brought about by the global dynamo is simulated by adding homogeneous vertical magnetic fields of 100 G, 200 G and 300 G to the initial SSD set-up41 (hereafter referred to as 100 G, 200 G and 300 G cases, respectively). These initially homogeneous and vertical magnetic fields rapidly evolve to a statistically steady state as our simulations relax. This state is highly inhomogeneous: strong, nearly vertical magnetic fields condense in the downflow lanes (intergranular lanes), while convective cells (granules) harbour relatively weak fields (Methods and Extended Data Fig. 1).

In the second step, we bridge atmospheric models produced by MURaM to observational data. We make the connection by ‘post-processing’ the MURaM output, by ray tracing through the cubes (representing stellar atmosphere) along several directions (Methods). Along each ray, we compute the intensity emerging from the cube by using the MPS-ATLAS code, which uses the temperature and pressure along the ray. We integrate over all rays emerging from the cube along the given direction.

Magnetic limb darkening in Kepler measurements

We now turn to a more detailed description of the results in context with the physics. Our calculations indicate that spatially resolved measurements of the quiet Sun’s limb darkening42,43 can be very accurately reproduced by the SSD simulations that account for the intrinsic magnetization of the quiet Sun (Figs. 1 and 2). The inclusion of an additional magnetic field representing the global dynamo does not match the solar observations as the simulation systematically shows larger residuals to solar observations compared with the SSD simulations (Methods and Extended Data Fig. 2). This is reassuring, as the spatially resolved solar limb-darkening observations have been processed to avoid any distortion by magnetic activity43 and, thus, should correspond to the minimum possible magnetic activity, which is produced by the SSD set-up (see Methods for more details).

Fig. 2: Solar limb darkening.
figure 2

a,b, The spectral intensities (Iμ) at different disk positions given by μ (labelled on the left side in the figure) normalized to the disk centre intensity (Iμ=1). The solid lines correspond to our calculations for the SSD case (that is, they indicate spectra emerging from MURaM cubes as computed with the MPS-ATLAS code) and dot symbols are solar measurements by Neckel and Labs 1994 (NL94)43 (a) and Pierce, Slaughter and Weinberger 1977 (PSW77)42 (b), where manifestations of solar magnetic activity are excluded to the extent possible. c,d, The residuals (stars) in percentage between observations (NL94 in panel c and PSW77 in panel d) and computations (O–C) at different disk positions (different colours labelled in c). The red horizontal lines on these panels point to zero difference between observations and computations. Our model allows us to accurately reproduce solar limb-darkening measurements.

In contrast to the solar case, the explanation of the Kepler measurements requires the action of the global dynamo. Indeed, the point representing the mean offset for our sample of 30 Kepler stars (hereafter, full sample; Methods) lies very close to the lines connecting the points that illustrate different magnetic cases and next to the calculations corresponding to the 100 G case (Fig. 1). At the same time, the offsets of individual stars in the full sample show notable scatter (Extended Data Fig. 3a), which averages out when the mean offset is calculated. In addition to the full sample, we also consider a selected sample of 8 Kepler stars with −0.1 ≤ M/H ≤ 0.1 (so that they are better described by our solar simulations) and impact parameters of the transit b < 0.5 (reducing the errors in the limb-darkening extraction). The mean offset for the selected sample is very close to the mean offset of the full sample but the individual stars show much less scatter around the simulations (Extended Data Fig. 3b).

The close alignment of the mean offsets with the simulation line implies that our calculations with magnetic fields allow us to simultaneously explain the mean offsets in both limb-darkening coefficients and, therefore, reproduce the observed limb darkening within the error bars. Clearly, the magnetic field removes the discrepancy in the limb darkening, and its neglect in earlier models is probably the cause of this discrepancy. We note that our result does not necessarily imply that stars in the Kepler samples are on average more active than the Sun. Stellar measurements correspond to limb darkening along the transit path without any option of removing contributions from magnetic activity. Thus, the limb darkening obtained from planetary transits of stars will inherently contain contributions of magnetic activity. Consequently, a stronger magnetic field is needed to reconcile stellar models and observations.

All in all, our calculations show that magnetic fields make the stellar limb darkening less steep, leading to an increase (compared with the non-magnetic limb darkening) of the brightness at 0.75 of the stellar radius (μ = 2/3) and to an even stronger increase at 0.95 of the stellar radius (μ = 1/3). The smallest offset relative to the non-magnetic case is caused by the magnetic fields generated by an SSD (green star in Fig. 1). Despite the fact that an SSD fills the entire solar photosphere with a relatively large magnetic field (for example, the mean vertical field, \(\langle |B_z| \rangle\), at the visible surface is about 70 G; (ref. 33)), only a small fraction of these fields condense to local concentrations harbouring strong, that is, kilogauss magnetic fields32,33,40 resulting in only moderate heating of the photosphere.

In contrast, to the magnetic fields generated by an SSD, the fields brought about by the global dynamo, for example, those forming plages and the magnetic network of the Sun, have a more inhomogeneous spatial distribution and cluster in concentrations of up to several kilogauss44,45. These concentrations are often described as magnetic flux tubes46 and produce substantial changes in the thermal structure of the photosphere. Consequently, even a spatially averaged field of 100 G (once it has formed kilogauss concentrations through its interaction with the convection) in addition to the SSD-generated field produces a much stronger change of limb darkening than the pure SSD case. Larger spatially averaged magnetic flux densities, for example, 200 G and 300 G added to SSD simulations, lead to correspondingly larger changes of the limb darkening (Fig. 1).

In Table 1, we present the values of \({h}_{1}^{{\prime} }\) and \({h}_{2}^{{\prime} }\) coefficients for REFLD and 3D MHD MURaM simulations in the Kepler passband. One can see that limb darkening from REFLD and HD MURaM simulations (i.e. without magnetic field) are not identical (so that the cyan star symbol in Fig. 1 is not exactly at the origin). This is because REFLD are based on 1D calculations where convection is parameterized following the mixing length approximation38 while MURaM performs realistic 3D simulations of convection. We note that despite this imperfection in treatment of the convection, 1D models allow reliable calculations of the non-magnetic limb darkening and their dependencies on stellar fundamental parameters when the mixing length and overshoot parameters are adequately chosen17,36.

Table 1 Limb-darkening coefficients in the Kepler passband for the Sun

Magnetic limb darkening in the JWST era

The effect of the magnetic field on limb darkening affects the interpretation of the JWST transmission spectroscopy data. Indeed, the first JWST observations of transits in the WASP-39 b system14 performed with the NIRSpec47 PRISM showed that the deviation between observations and the currently available models persists throughout the spectral domain of these observations (about 0.5–5.5 μm). To quantify the effect of magnetic field on limb darkening over the JWST spectral domain, we show the dependence of \({{\Delta }}{h}_{1}^{{\prime} }\) and \({{\Delta }}{h}_{2}^{{\prime} }\) on the average magnetic field (with respect to the field-free MURaM HD simulation) as a function of wavelength in Fig. 3. The amplitude of the magnetic effect decreases towards longer wavelengths where emergent intensity is less sensitive to temperature changes caused by the magnetic field. At the same time \({{\Delta }}{h}_{1}^{{\prime} }\) and \({{\Delta }}{h}_{2}^{{\prime} }\) have rather complex spectral profiles, especially in the visible spectral domain where the darkening of the limb is strongly affected by atomic and molecular lines.

Fig. 3: Wavelength-dependent limb-darkening coefficients.
figure 3

a,b, We show the differences between limb darkening coefficients (\({{\Delta }}{h}_{1}^{{\prime} }\) in a and \({{\Delta }}{h}_{2}^{{\prime} }\) in b) resulting from MHD simulations with magnetic fields (SSD, 100 G, 200 G, 300 G) and from non-magnetic (HD) simulations. The colours distinguish between the various magnetic (SSD, 100 G, 200 G, 300 G) simulations entering the difference (see legend). The spectral resolving power of the calculations is about 400. The effect of the magnetic field on the limb darkening persists from the ultraviolet to the visible and into the infrared spectral domains.

The magnetically induced change of the limb darkening modifies the entire shape of transit profiles (Extended Data Fig. 4) and, in particular, the transit depth, which plays a crucial role in determining the radius of a transiting planet. The effect is especially strong shortwards of 2,000 nm, for example, a magnetic field of 100 G would induce a change of the transit depth larger than about 30–40 ppm for a Jupiter-size planet transiting the Sun (Fig. 4). Such changes can be observed with JWST even for a single transit observation and will also interfere with the interpretation of the JWST transit light curves. Indeed, the first JWST results14 indicate that the transit curves are not contaminated by systematic effects in most spectral channels, and the noise can be reduced to just a couple of ppm per spectral bin for most of the exoplanet target stars JWST observes (see Fig. 8 in ref. 14). Further observations also indicate that the precision of JWST transit depth measurements reaches the level given by the photon noise, which ranges from several up to hundred ppm depending on the brightness of a star, spectral resolution and wavelength domain of the observations48,49,50,51.

Fig. 4: Effect of surface magnetic field on transit depth for the exemplary case of a Jupiter-size planet transiting a solar twin.
figure 4

af, The difference in the depth of the transit (ΔDepth) calculated with the darkening of the limb corresponding to different degrees of magnetization (different colours) with respect to the darkening of the non-magnetic limb (HD) in ppm. The two columns show the ΔDepth at wavelengths shorter than (a,c,e) and longer than (b,d,f) 1,000 nm. The three rows correspond to different impact parameters (b = 0.0 (a,b), b = 0.5 (c,d) and b = 0.9 (e,f)) describing the transit path, which is schematically shown in the top-right corner of a, c and e. The bigger circle represents the star and the smaller represents the planet. In general, the difference in transit depth is always larger for stronger average stellar fields and is largest in the ultraviolet while decreasing towards longer wavelengths.

We expect the magnetic effect to also be measurable with the forthcoming PLATO mission. Indeed, our calculations for a central transit and a planet-to-star radii ratio of 0.1 show that the effect of a 100 G magnetic field on transit depth is 116 ppm. Corresponding values for 200 G and 300 G are 261 ppm and 405 ppm, respectively. This is substantially higher than the expected PLATO precision (50 ppm for V = 11 mag).

Discussion

Small-scale surface magnetic fields previously ignored in modelling of stellar limb darkening modify the atmospheric structure and therefore stellar limb darkening. We have shown that adding such magnetic fields into 3D radiation MHD simulations of stellar atmospheres solves the limb-darkening conundrum, that is, the inability of 1D and 3D magnetic field-free models of stellar atmospheres to return limb-darkening profiles consistent with observations.

The dependence of the limb darkening on the surface magnetic field can be seen as a curse or a blessing depending on one’s point of view. On the one hand, it introduces one more free parameter into the light-curve fitting. On the other hand, it offers the exciting possibility of deducing the magnetization of stars hosting transiting planets. In particular, the limb-darkening method opens a unique opportunity to obtain an estimate of stellar magnetic fields.

For solar twins (that is, stars with solar fundamental parameters), this can be directly done by comparing observed limb darkening with the values of magnetic limb darkening from Table 1. For stars with different fundamental parameters, one would first need to calculate differences between observed and non-magnetic REFLD limb darkening (available online via the Max Planck Digital Library at https://doi.org/10.17617/3.NJ56TR, via the ExoTiC-LD python package52 at https://github.com/Exo-TiC/ExoTiC-LD/ and via the ExoTETHyS python package53 v2.0.10 at https://github.com/ucl-exoplanets/ExoTETHyS). Then these differences must be compared with the offsets between magnetic and REFLD limb darkening from Table 1 to determine the magnetization of a star. However, we note that this algorithm assumes that the magnetic field’s effect on limb darkening does not depend on stellar fundamental parameters. We expect this to be a reasonable assumption for stars that are not very different from the Sun (that is, for G dwarfs with −0.1 ≤ M/H ≤ 0.1; Methods). In a forthcoming publication, we will extend calculations of the magnetic limb darkening to stars with different fundamental parameters, allowing the magnetic field to be deduced for a broad class of stars with transiting planets. This is especially timely in anticipation of the upcoming PLATO mission, which will observe tens of thousands of bright stars in the lower main sequence54.

The effect of a magnetic field on limb darkening strongly depends on the wavelength (Figs. 3 and 4) and, thus, ignoring it might introduce spurious features in the transmission spectra obtained with JWST and eventually with ARIEL26. This underscores the importance of accounting for the magnetic effect on limb darkening in the analysis of transmission spectra.

Methods

Calculations with MURaM and MPS-ATLAS codes

We utilized the 3D radiative MHD code MURaM29,37 (which stands for MPS/University of Chicago Radiative MHD) to simulate the solar atmosphere with different degrees of magnetization using the ‘box-in-a-star’ approach (that is, simulating a small representative volume that encompasses the stellar or solar surface and near-surface layers both below and above the surface55). Then we used the MPS-ATLAS code56 to synthesize emergent spectra from the MURaM cubes. MPS-ATLAS utilizes a generalized version57,58 of the opacity distribution functions approach59, where high-resolution (R = 500,000) opacity is rebinned to a lower resolution grid (R ≈ 400 in the visible spectral domain). This allows for a fast spectral synthesis, even when accounting for more than 100 million atomic and molecular transitions60. The full list of opacity sources (including continuum opacities) and a detailed description of the MPS-ATLAS code are given in ref. 56. Both the MURaM and MPS-ATLAS codes have been extensively tested and validated by a number of very sensitive observational tests in numerous publications15,37,61,62,63.

MURaM solves the MHD conservation equation for partially ionized and compressible plasma to model mass, momentum and the energy transport. The transfer of radiative energy is calculated following a multi-group opacity method64 using 12 opacity bins63 constructed from the same opacity distribution functions that are used for the spectral synthesis.

The size of the MURaM box in our simulations is 9 Mm × 9 Mm (512 × 512 grid points) in the horizontal direction and 5 Mm (500 grid points) in the vertical direction (4 Mm below the optical surface into the convection zone and 1 Mm above it, covering the lower stellar atmosphere and in particular the photosphere). We use the same formulation of the boundary conditions as in ref. 33. It allows for deep recirculating of the field through the presence of a horizontal field in the upflow regions at the lower boundary of the simulation cube29,40. Such a boundary condition results in the generation of a magnetic field at the solar surface whose averaged value does not depend on the depth of the simulation cube29 and allowed us to explain ubiquitous small-scale horizontal and mixed-polarity magnetic fields that are always present at the solar surface65,66. To cover the range of possible facular magnetic flux densities, we also executed simulations with added initially vertical, unipolar and homogeneous magnetic fields of 100 G, 200 G and 300 G to the set-up we used for simulating quiet regions, including the SSD. The simulations are then allowed to relax and the magnetic field to interact with the convection, finally leading to kilogauss magnetic features in the intergranular lanes, separated by regions (granules) with very weak fields. This approach allows emulating magnetic fields in facular (plage) and network regions, which are thought to be generated by the action of a global dynamo and thus account for their effects on atmospheric structures41,45,67.

We ran our HD and SSD simulations for four solar hours each, while all simulations with an added vertical magnetic field were run for two hours each (after the field has relaxed into a statistically steady state). The MPS-ATLAS code56 was then used to calculate spatially averaged spectra emergent from the cubes with 90 second cadence at 10 disk positions, from the disk centre (μ = 1.0) to the limb (μ = 0.1) with a step in μ of 0.1. The intensity emerging from one snapshot of our 100 G simulations is shown in Supplementary Fig. 1 at three wavelengths and for three μ values.

Subsequently, the computed spectra were time-averaged to effectively average out the variability of the spectra caused by granulation and oscillations. Finally, these averaged spectra are used to calculate the limb darkening in the Kepler passband. We have used the time series of our spectra to calculate the error of the mean spectrum in the Kepler passband and have checked that it is well below 0.1% at all disk positions for all the magnetizations considered.

Dependence of the limb darkening on stellar fundamental parameters and magnetic field

The limb darkening strongly depends on stellar fundamental parameters, that is, effective temperature, metallicities and surface gravity15,16,68. REFLD was computed for specific fundamental parameters of stars from the Kepler sample considered. We then perform time-costly 3D radiative MHD simulation runs of magnetic effects only for a star with solar fundamental parameters. In other words, we used REFLD to account for a pretty strong dependence of limb darkening on fundamental parameters15 and then calculated the magnetic effect using a solar simulation. The latter is a good approximation as stars in the considered Kepler sample have near-solar fundamental parameters.

Magnetic field modifies the limb darkening curve. In Table 1, we present the 3D MURaM limb darkening coefficients derived from the limb darkening with different levels of magnetization in the Kepler passband. The increase of magnetic field makes the limb darkening shallower, that is, brightness near the limb relative to disk centre drops by a small amount. This is reflected in both coefficients: \({h}_{1}^{{\prime} }\) increases and \({h}_{2}^{{\prime} }\) decreases with increasing magnetic field. The largest drop in intensity from centre to limb is produced by non-magnetic (HD) simulations. In Extended Data Fig. 3a, we show offsets between observed and REFLD limb darkening for stars from our full Kepler sample. This sample consists of stars from ref. 12, where we excluded three most active stars (HAT-P-7, Kepler-17, Kepler-423) with the ratio of in-transit to out-of-transit variability larger than 1.2 (see ref. 12). While a large number of stars cluster along the computed dependence of \({{\Delta }}{h}_{1}^{{\prime} }\) and \({{\Delta }}{h}_{2}^{{\prime} }\) on magnetic field, there are also some outliers. There are two main reasons for these outliers. First, there are observational errors that are averaged out in the comparison presented in Fig. 1. Second, while one can expect that the amplitude of the magnetic effect on the limb darkening depends on stellar fundamental parameters, our calculations are limited to the Sun. In Extended Data Fig. 3b, we separately show the stars with near-central transits (impact parameter b < 0.5) so that the planetary trajectory crosses a relatively large part of the stellar disk and therefore extraction of limb darkening is more reliable. From those stars, we create our selected sample, focusing on stars with near-solar metallicity (−0.1 ≤ M/H ≤ 0.1). These stars show much less scatter around the simulation line.

All in all, Extended Data Fig. 3 hints that the effect of magnetic field on limb darkening strongly depends on metallicity. At the same time, it shows that solar calculations can be used for stars with metallicity values −0.1 ≤ M/H ≤ 0.1.

Test against solar measurements

We compare our calculations of the limb darkening for the quiet solar conditions (SSD case) to spatially resolved narrow-band solar measurements42,43 at a number of continuum wavelengths (Fig. 2). These measurements have been processed by the observers to remove any apparent manifestation of magnetic activity. Our model demonstrates an excellent agreement with these observations (within 2% difference around 400 nm and decreasing to less than 1% towards the infrared). This agreement stems partly from the fact that the 3D MURaM calculations include comprehensive calculations of the convection and overshoot63, which allows an accurate reproduction of the limb darkening. In the blue spectral range, it is difficult to find real continuum where the measurements are done, so the errors are larger in this region, but decreasing towards the infrared. In Extended Data Fig. 2, we present the comparison of the solar measurements with the computations with higher magnetic fields (100 G, 200 G and 300 G) at different disk positions. Increasing magnetic field leads to larger difference between observations and computations (Extended Data Fig. 2), leading us to conclude that the best model to reproduce quiet Sun measurements is the SSD model. In particular, our SSD model shows a good performance in the spectral region above 500 nm. This is encouraging as most of the transit photometry and spectroscopy measurements are performed in this spectral domain (Table 2).

Table 2 Wavelength ranges of some existing or planned photometric (Kepler35, TESS70, CHEOPS71, PLATO54) and spectroscopic (JWST/NIRSpec47, ARIEL26, ELT/METIS72) instruments

Spatial distribution of magnetic field on the solar surface

We present the horizontal distribution of vertical magnetic field in Extended Data Fig. 1 for the same still from which we computed the intensity maps (Supplementary Fig. 1). The magnetic field in the intergranular lanes and in the forming active regions reaches values of up to about 1–2 kilogauss, while for the granules the vertical magnetic field is quite small.

Wavelength range and precision of considered instruments

In Table 2 we present the list of instruments used for detection of planetary transits and for transmission spectroscopy.

Transit light curves

The change of the limb darkening induced by surface magnetic field affects the entire transit profile. In Extended Data Fig. 4, we illustrate this for the exemplary case of the transit of WASP-39 b in front of its host star. The calculations have been performed by approximating the limb darkening of WASP-39 by that of the Sun (which is reasonable for illustrative purposes as WASP-39 has near-solar fundamental parameters, Teff = 5,400 K ± 150 K and M/H = −0.12 ± 0.1) and using the orbital parameter of WASP-39 b from Table 1 of ref. 14.

The effect of the magnetic field

There are two main mechanisms of the magnetic field by which it impacts the limb darkening. First, a magnetic field leads to the extra heating of the middle and upper photosphere, decreasing the temperature gradient and, thus, making limb darkening less steep. Second, a magnetic field leads to a pronounced corrugation of the optical surface69. Closer to the limb, deeper and hotter layers of granular wall are seen, leading to an increase of brightness relative to the non-magnetic case69.

In Fig. 1, we assess the relative contribution of these two effects. Namely, we show the effect of magnetic field on horizontally averaged temperature structure in our simulations and compare limb darkening computed from these averaged 1D structures with full calculations. While the 1D calculations account for the extra heating of the photosphere, only the full 3D calculations can catch the corrugation of the optical surface and the effect of hot granular walls. Heating of the photosphere explains approximately 50% of the magnetic effect for μ 0.5. At the same time, it has very little effect on near the limb regions magnetic brightening is driven by the 3D effects.